I'm trying to render my home
template without the default layoutTemplate
. Iron-router Guide shows I need to use Router.onBeforeAction
. I just can't figure out how exactly to implement it.
Router.configure({
layoutTemplate: 'navbar'
}
Router.route('/', {name: 'home'});
You can override the default layout template by calling this.layout();
in your route. Either you supply a different layout template, eg this.layout('homeLayout');
or you just leave the arguments empty.
For example:
Router.route('/', function () {
this.layout();
this.render('home');
}, {name: 'home'});
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.