In AngularJS I have a directive that watches a scope variable. When the variable contains certain data then I need to alter that variable a bit. The problem is that when I c
you can manage it using a bool variable
$scope.someVarChanged = false; scope.$watch('someVar', function(newValue, oldValue) { console.log(newValue); $scope.someVarChanged = !$scope.someVarChanged!; if($scope.someVarChanged) { scope.someVar = [Do something with someVar]; } });