Angular › Standalone Components

How would you migrate an existing NgModule based Angular application to standalone components?

Advanced

Answer

Angular provides an official CLI schematic that automatically analyzes your existing NgModules and converts your components, directives, and pipes to standalone versions, updating their imports accordingly, significantly reducing the manual work needed for a large scale migration.
ng generate @angular/core:standalone

// Offers several migration steps, such as converting components to standalone
// and removing now unnecessary NgModule declarations
Real-world example A team running an older, large Angular application uses the official migration schematic to convert the vast majority of their components to standalone automatically, only needing to manually review and fix a handful of edge cases afterward.

Common follow-ups: What parts of a migration typically still need manual review after running the automated schematic?;Should a large application migrate all at once, or gradually feature by feature?