diff --git a/.gitignore b/.gitignore index ac65240..378c898 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,4 @@ node_modules/ coverage/ junit/ dist/ -out/ \ No newline at end of file +out/ diff --git a/src/sortable.js b/src/sortable.js index 14c2679..1136a76 100644 --- a/src/sortable.js +++ b/src/sortable.js @@ -294,7 +294,7 @@ angular.module('ui.sortable', []) return inner; }; - scope.$watch('uiSortable', function(newVal /*, oldVal*/) { + scope.$watchCollection('uiSortable', function(newVal /*, oldVal*/) { // ensure that the jquery-ui-sortable widget instance // is still bound to the directive's element var sortableWidgetInstance = getSortableWidgetInstance(element); diff --git a/test/sortable.e2e.spec.js b/test/sortable.e2e.spec.js index 1be9306..65c12dd 100644 --- a/test/sortable.e2e.spec.js +++ b/test/sortable.e2e.spec.js @@ -446,6 +446,36 @@ describe('uiSortable', function() { }); }); + it('should work when "helper: clone" and "appendTo" options are used together', function() { + inject(function($compile, $rootScope) { + var element; + element = $compile('