Skip to content Skip to sidebar Skip to footer

How To Go Back To Previous Page Without Refreshing In Angularjs?

I currently have an AngularJS application with routing built in. It works and everything is ok. where i have 2 controller. in first controller i have a button when i click button

Solution 1:

angularjs will always execute controllers when ever page is get redirected from one page to another page if you written controller as page specific.

If your application is SPA then you can rewrite by specifying a controller before declaring ng-view (its not a good practice).as

<divng-controller="controller as cont"><divng-view></div></div>

now it will hold all your data until the application get closed.but, you should aware of cache.

Post a Comment for "How To Go Back To Previous Page Without Refreshing In Angularjs?"