Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 238
radixhound Avatar asked Jun 28 '12 23:06

radixhound


1 Answers

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.

like image 109
Bradley Priest Avatar answered Nov 03 '22 07:11

Bradley Priest