While trying to access window.location or window.history directly, how can I do the following in AngularJS:
- Replace the history for current location
- Redirect to a new location
For example:
- user goes to "/#/loc1"
- I want the history to show they went to "/#/loc2"
- Then redirect to "/#/loc3"
- If they use the browser.back, it should return them to "#/loc2"
While trying to access window.location or window.history directly, how can I do the following in AngularJS:
- Replace the history for current location
- Redirect to a new location
For example:
- user goes to "/#/loc1"
- I want the history to show they went to "/#/loc2"
- Then redirect to "/#/loc3"
- If they use the browser.back, it should return them to "#/loc2"
1 Answer
Reset to default 11Is this what you want?
$location.path('/blahblah').replace();
See API Docs for $location
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1743729968a4497264.html
评论列表(0条)