Skip to content
This repository was archived by the owner on Sep 8, 2020. It is now read-only.

Commit cd2c894

Browse files
committed
refactor(sortable): replace for-in-hasOwnProperty with angular.forEach
This also brings code coverage back to 100%.
1 parent ff84d4e commit cd2c894

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/sortable.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,9 @@ angular.module('ui.sortable', [])
101101
_isCanceled: false,
102102
_isCustomHelperUsed: ui.item.sortable._isCustomHelperUsed,
103103
_destroy: function () {
104-
for (var key in ui.item.sortable) {
105-
if (ui.item.sortable.hasOwnProperty(key)) {
106-
ui.item.sortable[key] = undefined;
107-
}
108-
}
104+
angular.forEach(ui.item.sortable, function(value, key) {
105+
ui.item.sortable[key] = undefined;
106+
});
109107
}
110108
};
111109
};

0 commit comments

Comments
 (0)