Okay, this is a strange problem I've never had before and I didn't see anyone else having this problem on the Internet;
For starters, I'm using AngularJS
and the $scope
variables.
While using AngularJS i've noticed my variables are showing both the value that was set in the beginning of the controller, for example:
$scope.editMode = true;
And the value I have set for them in a function inside of the controller, which in that case the function was triggered by a click. For example:
$scope.disableEditMode = function() {$scope.editMode = false;}
I'm running an interval of a second in the controller to check the variable's value, which is showing me that it is true and then false, and so on...
Why is it changing by its own? Or why is it having both of the values? What's going on here?
By the way, I'm not sure if that's a reason for this problem, but on the click event which changes the variable value I'm also redirecting the user to another page that uses the same controller, which I thought it might reset that data for the variable but it is clearly not the case.
Thanks.