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

how to chunk appart an angular dynamicaly injected component #345

Open
phil123456 opened this issue Jun 6, 2017 · 3 comments
Open

how to chunk appart an angular dynamicaly injected component #345

phil123456 opened this issue Jun 6, 2017 · 3 comments

Comments

@phil123456
Copy link

phil123456 commented Jun 6, 2017

Hi,

the seed, apparently, automates the separation of components that are lazy loaded ... just amazing

but how do I force a particular angular component to be chunked separately ?
I add that component dynamicaly, by injecting it in a template

let componentFactory = this.componentFactoryResolver.resolveComponentFactory(adItem.component);
let viewContainerRef = this.adHost.viewContainerRef;
let componentRef = viewContainerRef.createComponent(componentFactory);

[I came here since nobody replies in stack overflow]

thanks

@Foxandxss
Copy link
Member

No SO nor the issue you opened in the angular repo for the DCL guide :P

I am not sure if I follow you problem nor if if you can fix it with webpack.

@phil123456
Copy link
Author

phil123456 commented Jun 6, 2017

"No SO nor the issue you opened in the angular repo for the DCL guide :P"

I have no idea what this phrase means :-) SO ?DCL ? the issue I opened ???

if you do lazy loading, webpack creates a separate chunk...js , right ? and it is fetched when you navigate

so as I inject a component in a template dynamicaly, I want it to be in a separate chuk too and fetched when I insert the component too.... angular is so static ...

dynamic content can be loaded so easily with regular php/js application

@Foxandxss
Copy link
Member

I have no idea in how to do that, sorry.

And with the issue I mean angular/angular#17158

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

2 participants