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)