Files
main.tsmain
What you'll learn
- Load a module on demand with LazyModuleLoader and a dynamic import(), and take providers from the module reference it returns
- Explain what the cache does on the second load, and read the console to see when the module was initialised
- List what a lazily loaded module cannot contain: controllers, lifecycle hooks, global providers
Press Run tests to start the app. Its log appears here.Graded endpoints
Some cats to report on
Second cat
The eager part of the application: no lazy module involved
ReportModule was not in the startup graph; this request loaded it, and the console shows it initialised only now
Data changes, the module does not
The module came from the cache: the same ReportService instance, fresh data