liveBook · Manning

Schematic

As explained in Modern Angular

A declarative generator that transforms project files and configuration according to a defined workflow.

A schematic is a declarative generator that transforms project files and configuration according to a defined workflow. In Angular, migration schematics automate large codebase changes while leaving developers responsible for verification and cleanup. section 2.5.3 section 10.1.4

A standalone migration follows an ordered workflow:

  • Run ng g @angular/core:standalone on an Angular v16 application and choose Convert all components, directives, and pipes to standalone. section 2.5.3
  • Run the command again and choose Remove unnecessary NgModule classes, then test the application. section 2.5.3
  • Run it a final time and choose Bootstrap the application using standalone APIs, replacing AppModule with bootstrapApplication in main.ts. section 2.5.3

Automation is not bulletproof. Search for remaining NgModules, inspect standalone routing, and review third-party providers exposed through importProvidersFrom. Upgrade dependencies when standalone APIs are available, and test after each migration step. section 2.5.3

Incremental template migration

For Angular v17 or higher, run ng generate @angular/core:control-flow and select a directory. Convert subdirectories incrementally, remove obsolete NgIf, NgFor, and NgSwitch imports manually, review @for tracking expressions, and run regression tests. section 10.1.4

ng generate @angular/core:control-flow

Use the migration command as a starting point for converting structural directives to Angular's control-flow syntax. section 10.1.4

How Modern Angular covers it

How deep it goes
Explains commands, migration order, generated changes, manual cleanup, and testing, but stops short of implementing the transformer internals.
Examples
Uses standalone conversion, AppModule removal, control-flow migration, directory scoping, and @for tracking review as concrete cases.
What it assumes
Assumes an existing Angular project and basic familiarity with NgModules, templates, routing, and Angular CLI commands.
What you can do after
Operate Angular migration commands, review their changes, fix compatibility issues, and validate results incrementally.
How it connects
Connects Angular schematics with standalone components, NgModule migration, standalone APIs, structural directives, and control-flow syntax.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Modern Angular. The section links point to the parts of the book it draws on.