提交 ff3deb04 编写于 作者: L Lebedev Konstantin

Merge pull request #720 from livelazily/fix-un-watch

`scope` does not has "off" function
......@@ -71,6 +71,7 @@
options = angular.extend(scope.ngSortable || {}, ngSortableConfig),
watchers = [],
getSource = getSourceFactory(el, scope),
offDestroy,
sortable
;
......@@ -127,7 +128,7 @@
}
function _destroy() {
scope.$off('$destroy', _destroy);
offDestroy();
angular.forEach(watchers, function (/** Function */unwatch) {
unwatch();
......@@ -190,7 +191,7 @@
}));
});
scope.$on('$destroy', _destroy);
offDestroy = scope.$on('$destroy', _destroy);
}
};
}]);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册