Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
FarhanAbdulQayyum opened this issue Oct 11, 2017 · 0 comments

Comments

@FarhanAbdulQayyum
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant