Closed youyouttok closed 8 years ago
@youyouttok You could search for the first module's existence in an $interval and then load the next one. That's how I've done it. Can give you the code if you need it.
or you could use the parameter serie: true
so that it loads your files in serie
Shouldn't that be series
?
From the docs:
$ocLazyLoad.load({
serie: true,
files: [
'bower_components/angular-strap/dist/angular-strap.js',
'bower_components/angular-strap/dist/angular-strap.tpl.js'
]
});
There is no word serie
in the English language, I believe you intended to use series
.
Although serial
would probably be a more appropriate term here.
Sure.
Le jeu. 1 sept. 2016 20:46, Mr Friend notifications@github.com a écrit :
There is no word serie in the English language, I believe you intended to use series.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ocombe/ocLazyLoad/issues/339#issuecomment-244136222, or mute the thread https://github.com/notifications/unsubscribe-auth/AAQMom1071ylMynS5oj6a23_dps6G36Rks5qlv5jgaJpZM4JswIs .
@ocombe Thank you!I used serie in module config, and in route like this:
resolve: {
loadModule: ["$ocLazyLoad", function($ocLazyLoad) {
console.log(1);
return $ocLazyLoad.load(['ui.chart']);
}],
loadMyCtrl: ['$ocLazyLoad', 'loadModule', function($ocLazyLoad, loadModule) {
console.log(2);
return $ocLazyLoad.load({
files: ['../js/controller/chartController.js']
});
}]
}
it works!
@ohjames Thank you! I have used serie to solve the problem. I will try to use your solution to do it.
My solution was not good, it's much better to use serie
, you can compose the promise it returns for more advanced dependency trees.
Hello, angular-chart depend on Chart.js , but Chart.js could not be loaded before angular-chart.js.