Skip to content

How to dynamically load components in a lazy loaded module (ng2+)

Notifications You must be signed in to change notification settings

jbsouvestre/lazy-loaded-modules

Repository files navigation

This is an example repo that demos how to dynamically load components in a lazy loaded module in Angular 2+

This almost entirely relies on @jmcclanahan's answers in this thread: angular/angular#14324

App Structure:

[AppComponent] 
|
|
V
[HomeComponent] (lazyloaded)
|
|
V
[DynamicModule] --->  (Conditionally loads CompA or B)
|                   |
|                   |
V                   V
[ComponentA]        [ComponentB]

Injector Graph

dependency graph

About

How to dynamically load components in a lazy loaded module (ng2+)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published