NG update Migrations — Angular 21
Migrations available with the ng update Angular CLI command for Angular 21. Details and example diffs below.
Migrate application projects to the new build system. Application projects that are using the '@angular-devkit/build-angular' package's 'browser' and/or 'browser-esbuild' builders will be migrated to use the new 'application' builder. You can read more about this, including known issues and limitations, here: https://angular.dev/tools/cli/build-system-migration
No example diff available for this migration yet.
Converts the entire application to block control flow syntax
No example diff available for this migration yet.
Update 'moduleResolution' to 'bundler' in TypeScript configurations. You can read more about this, here: https://www.typescriptlang.org/tsconfig/#moduleResolution
No example diff available for this migration yet.
Remove any karma configuration files that only contain the default content. The default configuration is automatically available without a specific project file.
No example diff available for this migration yet.
Replaces usages of the deprecated Router.getCurrentNavigation method with the Router.currentNavigation signal
No example diff available for this migration yet.
Adds `BootstrapContext` to `bootstrapApplication` calls in `main.server.ts` to support server rendering.
No example diff available for this migration yet.
Moves imports of `ApplicationConfig` from `@angular/platform-browser` to `@angular/core`
No example diff available for this migration yet.
No example diff available for this migration yet.
Ensures that the Router.lastSuccessfulNavigation signal is now invoked
The `lastSuccessfulNavigation`Router property is now a Signal and has to be invoked to get its value.
| Before | After |
|---|---|
| constructor() { | constructor() { |
| if(this.router.lastSuccessfulNavigation) { | if(this.router.lastSuccessfulNavigation()) { |
| // ... | // ... |
| } | } |
| } | } |
Updates the 'lib' property in tsconfig files to use 'es2022' or a more modern version.
No example diff available for this migration yet.