Angular CLI Migrations
Explore available Angular CLI migration scripts and their availability across versions.
| Script Name | Description | Introduced Version | Command | |
|---|---|---|---|---|
| router-testing-module | Convert deprecated RouterTestingModule usages to the recommended modern APIs. | 21.0.0Next | ng g @angular/core:router-testing-module-migration  | |
| ngstyle-to-style | Convert NgStyle directive usages to style bindings . | 21.0.0Next | ng g @angular/core:ngstyle-to-style  | |
| ngclass-to-class | Convert ngClass directive usages to class bindings. | 21.0.0Next | ng g @angular/core:ngclass-to-class  | |
| self-closing-tags | Convert component selectors in the templates to self-closing tags. | 19.2.0 | ng g @angular/core:self-closing-tag  | Doc | 
| unused-imports | Removes all unused standalone imports across the entire project. | 19.1.0 | ng g @angular/core:cleanup-unused-imports  | Doc | 
| signal-queries | Convert decorator queries to signal queries. | 19.0.0 | ng g @angular/core:signal-queries-migration  | Doc | 
| output | Convert outputs from the decorator version to the output function. | 19.0.0 | ng g @angular/core:output-migration  | Doc | 
| signal-input | Convert `@Input()` declarations to signal inputs. | 19.0.0 | ng g @angular/core:signal-input-migration  | Doc | 
| route-lazy-loading | Convert eagerly loaded component routes to lazy-loaded routes. | 18.2.0 | ng g @angular/core:route-lazy-loading  | Doc | 
| inject | Converts classes using constructor-based injection to the inject function. | 18.2.0 | ng g @angular/core:inject  | Doc | 
| control-flow | Replaces the existing usages of *ngIf, *ngFor, and *ngSwitch to their equivalent block syntax. | 17.0.0 | ng g @angular/core:control-flow  | Doc | 
| standalone | Convert an application to standalone components, directives, and pipes. | 15.2.0 | ng g @angular/core:standalone  | Doc | 
router-testing-module
Convert deprecated RouterTestingModule usages to the recommended modern APIs.
Introduced: 21.0.0
ngstyle-to-style
Convert NgStyle directive usages to style bindings .
Introduced: 21.0.0
ngclass-to-class
Convert ngClass directive usages to class bindings.
Introduced: 21.0.0
self-closing-tags
Convert component selectors in the templates to self-closing tags.
unused-imports
Removes all unused standalone imports across the entire project.
route-lazy-loading
Convert eagerly loaded component routes to lazy-loaded routes.
inject
Converts classes using constructor-based injection to the inject function.
control-flow
Replaces the existing usages of *ngIf, *ngFor, and *ngSwitch to their equivalent block syntax.
standalone
Convert an application to standalone components, directives, and pipes.