简体   繁体   中英

Go to previous state in StateManager

How can I "go back" to the last currentState ? Does Ember provide a forward/backward implementation, something like window.history.back() ?

The back/forward button on the browser will update URLs which will trigger router to transition. When this occurs, a navigateAway event will be sent to the current Route, so you have a chance to do whatever clean up may be necessary.

BTW, if you think through this problem, you will realize that the user could tap a bookmarklet or manually update the URL at any time, which means you could be transitioning from any route to any other route in your app. That's a nasty combinatorial problem, and probably one that is not worth solving for most apps.

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