How do you upgrade Angular to a new major version safely?
Model answer
Read the update guide for your versions, and update one major version at a time with ng update, which runs automatic migrations: ng update @angular/core @angular/cli. Commit a clean state first, run the build and tests after each step, and check third-party libraries for compatible versions.
Fix deprecations when they appear, since removed features can cause failures in the next version. Keep a regular upgrade habit, because small, frequent upgrades are easier than one big jump.
Learn this topic
Angular Tutorial: Beginner to Advanced .
Sign in to add your own answer.
More questions
- How do you write a unit test for a component or a service in Angular?
- What is the difference between unit, integration and end-to-end tests?
- How do you test a component that calls an API?
- How do you test route guards, pipes and directives?
- What does ng lint and a formatter give you, and what other tooling do Angular teams use?
- How do you handle environment-specific settings in Angular?