简体   繁体   中英

Ember.js: Whats the difference between Router / Route and StateManager / State?

It seems like older examples of routing use StateManager and newer examples use the concept of Router . What is the difference and why you would use one over the other?

Router and Route are just subclasses of StateManager and State, originally the routing specific code was added directly to the StateManager code, but in the last few weeks effort has been made to extract it out.

Basically use the Router for the core flow of your app which deals with URLs and so forth, but if you need to use additional state managers in other places in your application, you can use StateManager/State without the extra Routing code being included when it's not needed.

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