ocLazyLoad
ocLazyLoad copied to clipboard
Double nested dependency
Let's say I want to lazy load module1
-
module1depends onmodule2 -
module2depends onmodule3(module3defines a property onwindowthatmodule2uses).
Should this work:
$ocLazyLoad.setModuleConfig({name: 'module1', files: ['module1.js']});
$ocLazyLoad.setModuleConfig({name: 'module2', files: ['module2.js']});
$ocLazyLoad.setModuleConfig({name: 'module3', files: ['module3.js']});
$ocLazyLoad.load('module1');
What I find is that module2 is correctly executed before module1, but module3 is not loaded at all. Is this expected? Is there a way around this other than specifying in every module for which module2 is a dependency that module3 is also a dependency?
For a full example check out this plunker. You'll need to have the console open to see the issue.