ng-sortable
ng-sortable copied to clipboard
scope.$watchGroup is not a function
i have to support angular 1.2.25 application ,i am using ng-sortable 1.3.5 it get the following error "scope.$watchGroup is not a function", scope.$watchGroup is supported only for version from 1.3 and above as per comments in this issue https://github.com/a5hik/ng-sortable/issues/192 ng-sortable should work with all version as in 1.1, 1.2, 1.3, 1.4
Ran into this issue as well updating the library on a v1.2.25 module.
I was able to get around this by removing the scope.$watchGroup
call and using individual scope.$watch
statements as follows:
scope.$watch('sortableScope.isDisabled', function (newValue) { if (isDisabled !== newValue) { isDisabled = newValue; if (isDisabled) { unbindDrag(); } else { bindDrag(); } } else { bindDrag(); } });
scope.$watch('sortableScope.options.longTouch', function (newValue) { if(isLongTouch !== newValue) { isLongTouch = newValue; unbindDrag(); bindDrag(); } else { bindDrag(); } });
Hope this helps