Created
June 9, 2015 17:55
-
-
Save kalyco/dcf3b393bbe47ce851a9 to your computer and use it in GitHub Desktop.
Ember's order of operations
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. User hits a URL | |
2. Ember's Router recognizes it and passes it to a Route object | |
3. The Route sets up a Controller and supplies it with a Model | |
4. The Model provides the View layer (represented by a Template) access to the data | |
5. Any properties defined by the Model are available to the Controller | |
ex: if User has first_name, your template has direct access to it through the Controller | |
*** don't need to define an empty controller method like in Rails *** | |
*** Ember will also generate the controller for you if one does not exist *** | |
Ember's magic is in naming conventions. | |
If you have a UserRoute, | |
by default Ember will pass off to a UserController, | |
that Controller will look for a Template in users/user.hbs | |
If you aren't using a Template, Route, or Controller, don't make it. | |
Unlike Rails, the files do not need to be automatically generated. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment