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
