Say I have two views that share a controller. Both views use the ng-route service
. If a scope variable is changed in one view and then you switch to the second view, how come the second view doesn't update?
Example
: My controller has a variable that = "hello"
. I output this variable just fine in both views. In view one
I have an onclick
that updates the variable to say "Whatsup"
. That works fine, but after the event I switch views and the second view is outputting "hello"
still. Is there a way to share these? If not, then what is a technique to share data?