Closed vorillaz closed 9 years ago
Sure, you could write it like this:
$stateProvider.state('app.demo', {
url: "/app/demo",
views: {
"view": {
templateUrl: '/partials/demo.html'
}
},
resolve: {
deps: ['$ocLazyLoad', function ($ocLazyLoad) {
//this module should be established before its plugins
return $ocLazyLoad.load(['module', 'module.plugin1', 'module.plugin2', 'js/ctrls/demoCtrl.js'], {serie: true});
}]
}
})
I was missing the serie
property. Nicely done. I hope to find somehow the time to write down a tutorial about my usecase. Cheers :)
:+1:
If we implement like this, after load how to inject the new module?
Hello there again. I have a state in my provider and I lazy load some modules to use. I am trying to load synchronously a module and it's plugins. The plugins require the module to be established. My code works just fine I am just wondering if I kinda can improve the syntax as I hate nesting functions . Here is a sample of my code: