javascript - Override Ember application.hbs template -
i have ember js application 99% of it's resources on root level, user has logged in access. resources, exception of /login
, have same template.
/login
, however, has entirely different template (no nav bar, etc). what's best way override application.hbs template login page?
most of answers see in other questions involve sort of parent route authenticated routes, so:
this.route('login'); this.route('main', { path: '/' }, function() { this.route('posts'); });
that solution yields right url's, means link-to helpers , such have use 'main.posts', etc routes, rubs me wrong way, , i'd not have extraneous route level on place.
in rails, i'd layout: nil
, , and prevent main template being applied. there equivalent in ember, or way achieve same goal cleanly?
to rid of {{link-to 'main.posts'}}. can add {resetnamespace:true} given route.
this.route('main', {path:'/'}, () => { this.route('posts', {resetnamespace:true}); });
{{link-to 'posts'}} navigate posts route
Comments
Post a Comment