Practical Guide: Angular Lazy Loading Key Points

To know anything essential like WHY, WHAT and HOW, please read the document from Angular official site:

Here just summarize some key points for experienced developers to start immediately.

  • In the file of of every lazy-loading module, use forChild()
  • In the file of of the root module, use () but not
  • In the file of of the root module, remove all the lazy-loading modules from “imports” list. Otherwise, lazy loading won’t work!