May 2018
Intermediate to advanced
512 pages
11h 3m
English
Now that you understand how eager-loading of modules work, you will be able to better understand the code we are about to write, which may otherwise seem like black-magic, and magical (aka misunderstood) code always leads to spaghetti architectures.
We will now evolve the eager-loading solution to be a lazy-loading one. In order to load routes from a different module, we know we can't simply import them, otherwise they will be eagerly loaded. The answer lies in configuring a route using the loadChildren attribute with string informing the Router how to load a submodule in app-routing.module.ts:
Read now
Unlock full access