Closed WilliamHua closed 9 years ago
All you have to do is:
// The simplest case; add other parameters to the route as you wish
Router.route( '/', {
controller: PreloadController,
'preload': {
'styles': '/plugins/yet_another_fancy_schmancy.css',
'sync': '/plugins/yet_another_fancy_schmancy.js'
}
});
Basically, all options are... well, optional ;) Try to play with them and see what happens :)
Awesome thank you!
From what I understand, to load a template that has a different name than route you typically do something like:
Router.route('/', function(){
this.render("templateName");
});
How would you combine that with pre-loader?
Your assumption is right. Equally, for example, you can do:
Router.route( '/', {
name : 'home',
template : 'main',
yieldTemplates: {
'news': {
to: 'mainContent'
}
},
/*
| If no extended controller has been provided for a particular route,
| a PreloadController itself should be assigned to the route
*/
controller: PreloadController
});
How do I load one JS file and one CSS file to a specific route/template without configuring all the other options?