DEV Community

Cover image for πŸ‘¨β€πŸ”§οΈ The 7 Pro Tips To Get Productive With Angular CLI & Schematics πŸ’ͺ
Tomas Trajan πŸ‡¨πŸ‡­
Tomas Trajan πŸ‡¨πŸ‡­

Posted on • Originally published at Medium

πŸ‘¨β€πŸ”§οΈ The 7 Pro Tips To Get Productive With Angular CLI & Schematics πŸ’ͺ

Quick Intro

There are many articles on how to build your own Angular schematics but in this one we’re going to focus on using available schematics to the fullest! πŸ’ͺ

Most of the time we will be using @schematics/angular which are provided in Angular CLI out of the box.

What are we going to learn

  1. Use shortcuts, they are much faster and easier to type, duhhh πŸ˜‚!
  2. Skip creation of an initial application
  3. Generate multiple applications and libs to promote code reuse
  4. Use schematics from different npm packages
  5. Set schematics defaults in angular.json file so that we don’t need to specify all the flags all the time
  6. Generate servicesβ€Šβ€”β€ŠprovidedIn: 'root' vs --module flag (scoping to lazy-loaded modules)
  7. Use ng add to add libraries like Angular Material (or others)

BONUS: Useful commands

BONUS+: Amazing code completion capabilities!

Read more...

Top comments (0)