ocLazyLoad icon indicating copy to clipboard operation
ocLazyLoad copied to clipboard

Can we define module inside other module of $ocLazyLoadProvider.config?

Open FarhanAbdulQayyum opened this issue 7 years ago • 0 comments

I want to lazy load services which are dependent on other services. For example Service A has service B as a dependency and service B has service C as dependency. In order to load A, services B and C must be loaded first. I want to lazy load all services when needed. I want to do something like this.

app.config(["$ocLazyLoadProvider", function ($ocLazyLoadProvider) { $ocLazyLoadProvider.config({ 'modules': [{ name: 'serviceA' files: ['serviceC.js','serviceB.js','serviceA.js'], serie:true }, { name: 'serviceB' files: ['serviceC.js','serviceB.js'], serie:true }, { name: 'serviceC' files: ['serviceC.js'], serie:true }, }] }) Now problem I am facing is that I have to mention all indirect dependencies. Like service C in case of loading A. Is there any way I can just invoke module serviceB in order to load serviceA and don't have to mention indirect dependencies like serviceC. like

            name: 'serviceA'
            files: ['serviceB','serviceA.js'],  ---------where service B is module name.
            serie:true

Is it possible to do module inheritance? What else can be done to achieve this in config? Because I don't want to do this in resolve.

FarhanAbdulQayyum avatar Oct 11 '17 12:10 FarhanAbdulQayyum