I am new to ember and I have been through the Ember JS Documentation
for a while and suddenly struck with two questions. I even surfed on the Internet for hours and barely could find a solution. So, here are they:
Question 1:
Quoting Ember Documentation,
The application is entered when your app first boots up. Just like any other route, it will load an application template by default.
application
in the above quote represents the application route
which according to the doc is loadedwhen app boots and renders the application.hbs
. Where is the application route situated?
Question 2:
Where exactly in the control flow does the router.js
file get loaded? Before application route or after application route?
Request:
Also I would be thankful if anyone could assist me with the complete flow of the Ember JS (starting when the user enters localhost:4200
).
Thanks.
I'll try and take a stab at this... but I'm also confused by some of this stuff.
application.js
route in your folder structure... but Ember creates it in the mystery zone behind the scenes. This is probably so that you don't need to think about surface area - if you're not using it explicitly. Just like that 'route' - it will create a controller too. The route is 'entered' before the template is rendered - because it'll need to define things like the model - which by the way / is just a property that is set on the possibly non-existant (to your knowledge) controller of the same name. (See route lifecycle hooks) Other implicit routes are /index /error /loading etc - and they are all there - for every route - even though you can't see the files. If you want to use them, you'll need to explicitly create them(use the CLI).Here are a few things to chew on:
dockyard.com/blog/2016/09/14/understanding-ember-s-resolver
EmberConf 2017: An Animated Guide to Ember Internals by Gavin Joyce
Also, Mike North's course on frontend masters goes into this stuff in detail. https://frontendmasters.com/workshops/ember/ - but you aren't just learning Ember... you're learning everything that ember is made from like es2015 - and there isn't a ton of empathy in that zone
If you can get past the initial mysteries - Ember is super fun. : )