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

Commit 704cc55

Browse files
committed
fix(sortable): use $watchCollection to track ngModel changes
1 parent c2b73e0 commit 704cc55

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/sortable.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ angular.module('ui.sortable', [])
9393

9494
// When we add or remove elements, we need the sortable to 'refresh'
9595
// so it can find the new/removed elements.
96-
scope.$watch('ngModel.length', function() {
96+
scope.$watchCollection('ngModel', function() {
9797
// Timeout to let ng-repeat modify the DOM
9898
$timeout(function() {
9999
// ensure that the jquery-ui-sortable widget instance

0 commit comments

Comments
 (0)