I have a factory in which I have declared a var which is being returned through a function. I am assigning an initial value to the var.
This function has a binding to a variable in a controller.
I also have another function in the factory through which I am changing the value of the var.
The problem is that the var rests to the original value, even after its value is changed through the second function.
Any ideas what is going on ?
Thanks, Murtaza
The problem was completely orthogonal.
I had a form on whose submission a value was being set. However I was using ng-click instead of ng-submit, which was causing the form to submit, and the page to reload. This was resetting the variables.