Thursday, 12 July 2018

Module Optimization Angular 6

This topic covers module optimization, moving items out of the main module which is app.modules.ts, lazy loading and sharing modules etc.

When adding a new component, directive etc, and we have multiple modules then we need to specify the module as well when creating these via the CLI.

> ng g c Hello --spec false --app
  1. Moving Routes out of the main module
  2. Moving Recipes related components declaration and routes to own feature module  
  3. Sharing modules
  4. Moving Shopping List components to own feature module
  5. Moving Auth components and routes to own feature module  
  6. Lazy Loading Recipes Module 
  7. Protecting Lazy Loaded Routes with canLoad

> Angular Samples
> MyRecipes Full Project Setup
> Angular 6 Samples