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)