ng-sortable icon indicating copy to clipboard operation
ng-sortable copied to clipboard

scope.$watchGroup is not a function

Open anoopsinghbayes opened this issue 8 years ago • 1 comments

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

anoopsinghbayes avatar Dec 14 '16 22:12 anoopsinghbayes

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

Ed-Hong avatar Jun 07 '18 15:06 Ed-Hong