简体   繁体   中英

Angular Browser History back without reload previous page

i have a AngularJS app with list of items and the detail of the item.

If I do some changes in detail and I want to return to list , list is already created again via remote request.

What is the best practice to stop reloading page after return from detail?

I tried to solve it via this topic:

angularjs getting previous route path

But without luck.

In list I'm using:

data-ng-controller="UsersCtrl" data-ng-init="initGrid()"

I think that problem is here.

Thanks for any advice and simple example.

The recommended approach here is to use services to provide the data so that you can serve up the same data when you return to the controller.

Your service should maintain the state of the previous view so that you can re-populate the scope when the controller is re-instantiated.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM