Back to results for “Project Structure”
Angular › Angular Schematics & Custom Builders

How would you use Angular's automatic update schematics to upgrade a project to a new major version?

Intermediate

Answer

Running ng update with the Angular package name automatically applies migration schematics that update your code to match breaking changes in the new version, such as renaming APIs or adjusting configuration files, saving significant manual work compared to reading through changelogs and fixing everything by hand.
ng update @angular/core @angular/cli

// Automatically updates dependencies and runs any needed migration schematics
// to adjust your code for breaking changes in the new version
Real-world example A team upgrading from an older Angular version to the latest one runs ng update, which automatically fixes several breaking changes in their configuration files, saving hours of manual migration work.

Common follow-ups: What happens if a migration schematic cannot fully automate a specific breaking change?;How do you check what version of Angular a project can safely update to next?