ocLazyLoad icon indicating copy to clipboard operation
ocLazyLoad copied to clipboard

Double nested dependency

Open redders6600 opened this issue 9 years ago • 0 comments

Let's say I want to lazy load module1

  • module1 depends on module2
  • module2 depends on module3 (module3 defines a property on window that module2 uses).

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.

redders6600 avatar Sep 30 '16 14:09 redders6600