I am facing some weird behavior with AngularJS in preserving a variable data which got binded to a from using scope, let me explain my scenario.
I have a form whose field values are initially served form controller through a scope variable, I need to compare the updated values with those initial values while saving, so I kept the initial data in a variable and assigned that variable to scope.
Whenever I change the form fields, controller variable data also getting updated along with scope variable. I am not sure whether this is the correct behavior or not, I guess only scope should get updated.
Anyone please suggest the correct behavior and how to solve this issue if that's the correct behavior.
You will get to know the problem easily by looking at the above JSBin link, let me know if needed any clarification.