NG update Migrations — Angular 21

Migrations available with the ng update Angular CLI command for Angular 21. Details and example diffs below.

use-application-builder

angular-cliIntroduced 18.0.0

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.

control-flow-migration

angularIntroduced 20.0.0

Converts the entire application to block control flow syntax

No example diff available for this migration yet.

update-module-resolution

angular-cliIntroduced 20.0.0

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-default-karma-config

angular-cliIntroduced 20.2.0

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.

router-current-navigation

angularIntroduced 20.2.0

Replaces usages of the deprecated Router.getCurrentNavigation method with the Router.currentNavigation signal

No example diff available for this migration yet.

add-bootstrap-context-to-server-main

angularIntroduced 20.3.0

Adds `BootstrapContext` to `bootstrapApplication` calls in `main.server.ts` to support server rendering.

No example diff available for this migration yet.

application-config-core

angular21.0.0

Moves imports of `ApplicationConfig` from `@angular/platform-browser` to `@angular/core`

No example diff available for this migration yet.

bootstrap-options-migration

angular21.0.0

Migrates deprecated bootstrap options to providers.

No example diff available for this migration yet.

router-last-successful-navigation

angular21.0.0

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.

BeforeAfter
constructor() { constructor() {
if(this.router.lastSuccessfulNavigation) { if(this.router.lastSuccessfulNavigation()) {
// ... // ...
} }
} }
Example commit

update-typescript-lib

angular-cli21.0.0

Updates the 'lib' property in tsconfig files to use 'es2022' or a more modern version.

No example diff available for this migration yet.