I use it $watchdynamically, so every call invokes its creation yet $watch, while I want to untie the previous one $watch.
$scope.pagination =function(){
$scope.$watch('currentPage + numPerPage', function (newValue,oldValue) {
$scope.contestList = response;
}
}
I have several tabs. When you click on the tab, the pagination function is called:
$scope.ToggleTab = function(){
$scope.pagination();
}
so it creates several $watch, and every time I click on the tab, it creates another one.
source
share