I have a basic scenario where i have to show different layout to guests vs authenticated users.
I tried to render other template than the application one by using below code in my route file:
renderTemplate(){
this.render('login', { // the template to render
into: 'guest', // the template to render into
// outlet: 'login', // the name of the outlet in that template
// controller: 'login' // the controller to use for the template
});
}
but when i do so i get Uncaught Error: Assertion Failed: You attempted to render into 'guest' but it was not found even though the files are all there which seems to be a bug(?).
The only way i managed to get this working is to output only {{outlet}} into the application.hbs template then in all my other templates do something like:
But seems that this.router.currentRouteName is undefined at init and in order to make it work i have to place it into a Ember.run.later call, which again, seems very odd to do.
So, that being said, what is the proper way to use various layouts?
I mean, why is this so hard to achieve, is like i am fighting the framework (most likely i am) ?