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

1

9

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?

Ira answered 28/6, 2012 at 23:46 Comment(0)
F
13

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.

Felon answered 29/6, 2012 at 0:16 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.