I can’t really figure out how to work with index and application templates, - there is something unclear about their behaviour. Here are some extracts from Ember guides.
- The index template will be rendered into the {{outlet}} in the application template.
- At every level of nesting (including the top level), Ember automatically provides a route for the / path named index.
- The application route is entered when your app first boots up. Like other routes, it will load a template with the same name (application in this case) by default. You should put your header, footer, and any other decorative content here. All other routes will render their templates into the
application.hbs
template’s{{outlet}}
.
So, following the above guide lines, I modified application.hbs
template to contain the navbar with login/logout buttons.
Then, after the User signed in, I redirect it to dashboard
route and in this case the dashboard.hbs
template gets injected into {{outlet }}
in the application.hbs
template.
The problem I have is as follows:
- If I use links only to navigate between different routes and pages in my app, it works fine.
- If I change the URL manually in the browser to
http://localhost:4200
, I have an empty page with just the navbar without the content ofdashboard
template.
How to do in this case ?
I’m using ESA as authentication add-on and redirect the user to dashboard
route after authentication:
#environment.js
ENV['ember-simple-auth'] = {
routeAfterAuthentication: 'dashboard'
};
Any ideas ? Thank you.