MiroHibler / meteor-preloader

A Meteor "lazy-loader" for external .js and .css libraries
75 stars 3 forks source link

Thrid party files are not getting loaded dynamically #1

Closed suriyabaskaran closed 10 years ago

suriyabaskaran commented 10 years ago

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

suriyabaskaran commented 10 years ago

resolved myself, seems like we should trigger the preload() method inside the router.map()

MiroHibler commented 10 years ago

That's right - preload() will initiate the actual loading:

  • preload Method called in the waitOn method to load route-specific files; it takes two parameters:

Probably I should change the docs to describe it more precisely...