Trusted answers to developer questions
Trusted Answers to Developer Questions

Related Tags

software projects

What are angular schematics?

Syed Muhammad Ali Mustafa


Schematics are part of the angular environment. A schematic is a tool that provides template codes to support complicated projects. It generates/modifies code and transforms the existing software projects.

Some transformations that it can apply to our project are:

  • Creating new components
  • Updating our code
  • Adding a new framework or configuration option to our project

The anatomy of angular schematics

An angular schematic has a collection of the following files:

Angular schematic anatomy

Goals of using schematics

The schematics collection is useful for creating or maintaining a project. It is also vital in customizing projects to align them with the requirements of our organization. The four primary goals of schematics are:

  1. Ease of use and development
  2. Extensibility and reusability
  3. Atomicity.Indivisible and irreducible.
  4. Asynchronicity.Executing in the background without blocking the caller.

npm installs schematics and packages them into collections.

Using schematics

A user can modify existing schematics or define their own. The schematics included in the @schematics/angular collection are run by default using the ng generate and ng add commands. We can use the following syntax to specify a particular schematic:

ng generate my-schematic-collection:my-schematic-name

We can also use this:

ng generate my-schematic-name --collection collection-name


software projects


Syed Muhammad Ali Mustafa
Copyright ©2022 Educative, Inc. All rights reserved

View all Courses

Keep Exploring