In this example, using ng-switch, I can switch between different views. Each view is assigned a controller.
I set a quick example here: http://jsfiddle.net/FBHjZ/1/
It seems that the controller is updated every time you switch views: If you enter the value of val in the input field, go to the main page and return to the settings, the value will be lost.
How can I prevent this? Basically, I want to keep state from previous views when switching between views.
source share