Closed suriyabaskaran closed 10 years ago
resolved myself, seems like we should trigger the preload() method inside the router.map()
That's right - preload() will initiate the actual loading:
preload
Method called in thewaitOn
method to load route-specific files; it takes two parameters:
Probably I should change the docs to describe it more precisely...
Here is my router.js, I am using meteor 0.8.2. I have a folder called vendors inside public. `Router.configure({ layoutTemplate: 'layout', preloadFiles: { // Use these on ALL pages 'common' : { js: ['/vendors/bootstrap-datepicker/js/bootstrap-datepicker.js', 'http://cdnjs.cloudflare.com/ajax/libs/jQuery-slimScroll/1.3.1/jquery.slimscroll.min.js',], css: '/vendors/bootstrap-datepicker/css/datepicker3.css' } } });
Router.map(function() {
this.route( 'home', { path: "/", controller: PreloadController, yieldTemplates: { 'header': {to: 'header'}, 'leftSidebar': {to: 'leftSidebar'}, 'footer': {to: 'footer'} } });
});
Router.onBeforeAction('loading');`
my meteor app is not preloading the necessary files