Packages

@angular/common

22.2.6 · 12 Nov 2026MIT8.1M / weekRepositoryHomepagenpmAtom feed

Your version

21.0.0

major19 Nov 2025Where it was published

21.2.26 is the newest release of 21.x.

In short

20 breaking1 deprecated

  • Breaking

    (test only) - TestBed now provides a fake PlatformLocation implementation that supports the Navigation API. This may break some tests, though we have not observed any failures internally. You can revert to the old default for TestBed by providing the MockPlatformLocation from @angular/common/testing in your providers: {provide: PlatformLocation, useClass: MockPlatformLocation}

  • Breaking

    ngComponentOutletContent is now of type Node | undefined instead of any | undefined.

  • Breaking

    NgModuleFactory has been removed, use NgModule instead.

  • Breaking

    Previously hidden type issues in host bindings may show up in your builds. Either resolve the type issues or set "typeCheckHostBindings": false in the angularCompilerOptions section of your tsconfig.

  • Breaking

    The Angular compiler now produces an error when the the emitDeclarationOnly TS compiler option is enabled as this mode is not supported.

  • Breaking

    The server-side bootstrapping process has been changed to eliminate the reliance on a global platform injector.

  • Breaking

    Using a combination of provideZoneChangeDetection while also removing ZoneJS polyfills will no longer result in the internal scheduler being disabled. All Angular applications now consistently use the same scheduler, and those with the Zone change detection provider include additional automatic scheduling behaviors based on NgZone stabilization.

  • Breaking

    TypeScript versions less than 5.9 are no longer supported.

Security

Release note

Blog post "Announcing Angular v21".

Breaking Changes

common

  • Breaking

    (test only) - TestBed now provides a fake PlatformLocation
    implementation that supports the Navigation API. This may break some
    tests, though we have not observed any failures internally. You can revert to the
    old default for TestBed by providing the MockPlatformLocation from
    @angular/common/testing in your providers:
    {provide: PlatformLocation, useClass: MockPlatformLocation}

  • Breaking

    ngComponentOutletContent is now of type Node | undefined instead of any | undefined.

  • Breaking

    NgModuleFactory has been removed, use NgModule instead.

compiler-cli

  • Breaking

    Previously hidden type issues in host bindings may show up in your builds. Either resolve the type issues or set "typeCheckHostBindings": false in the angularCompilerOptions section of your tsconfig.

  • Breaking

    The Angular compiler now produces an error when the
    the emitDeclarationOnly TS compiler option is enabled as this mode is
    not supported.

core

  • Breaking

    The server-side bootstrapping process has been changed to eliminate the reliance on a global platform injector.

    Before:

    const bootstrap = () => bootstrapApplication(AppComponent, config);

    After:

    const bootstrap = (context: BootstrapContext) =>
      bootstrapApplication(AppComponent, config, context);

    A schematic is provided to automatically update main.server.ts files to pass the BootstrapContext to the bootstrapApplication call.

    In addition, getPlatform() and destroyPlatform() will now return null and be a no-op respectively when running in a server environment.

  • Breaking

    Using a combination of provideZoneChangeDetection
    while also removing ZoneJS polyfills will no longer result in the
    internal scheduler being disabled. All Angular applications now
    consistently use the same scheduler, and those with the Zone change detection
    provider include additional automatic scheduling behaviors based on
    NgZone stabilization.

  • Breaking

    TypeScript versions less than 5.9 are no longer supported.

  • Breaking

    (test only) - Using provideZoneChangeDetection in the
    TestBed providers would previously prevent TestBed from rethrowing
    errors as it should. Errors in the test will now be rethrown, regardless
    of the usage of provideZoneChangeDetection. Tests should be adjusted to
    prevent or account for these errors. As in previous major versions,
    this behavior can be disabled with rethrowApplicationErrors: false in
    configureTestingModule as a last resort.

  • Breaking

    ignoreChangesOutsideZone is no longer available as an
    option for configuring ZoneJS change detection behavior.

  • Breaking

    Angular no longer provides a change detection scheduler
    for ZoneJS-based change detection by default. Add
    provideZoneChangeDetection to the providers of your
    bootstrapApplication function or your AppModule (if using
    bootstrapModule). This provider addition will be covered by an
    automated migration.

  • Breaking

    moduleId was removed from Component metadata.

  • Breaking

    The interpolation option on Components has been removed. Only the default {{ ... }} is now supported.

elements

  • Breaking

    Fix signal input getter behavior in custom elements.

    Before this change, signal inputs in custom elements required function calls to access their values (elementRef.newInput()), while decorator inputs were accessed directly (elementRef.oldInput). This inconsistency caused confusion and typing difficulties.

    The getter behavior has been standardized so signal inputs can now be accessed directly, matching the behavior of decorator inputs:

    Before:

    • Decorator Input: elementRef.oldInput

    • Signal Input: elementRef.newInput()

    After:

    • Decorator Input: elementRef.oldInput

    • Signal Input: elementRef.newInput

forms

  • Breaking

    This new directive will conflict with existing FormArray directives or formArray inputs on the same element.

platform-browser

router

  • Breaking

    lastSuccessfulNavigation is now a signal and needs to be invoked

  • Breaking

    Router navigations may take several additional
    microtasks to complete. Tests have been found to often be highly
    dependent on the exact timing of navigation completions with respect to
    the microtask queue. The most common fix for tests is to ensure all
    navigations have been completed before making assertions. On rare
    occasions, this can also affect production applications. This can be
    caused by multiple subscriptions to router state throughout the application,
    both of which trigger navigations that happened to not conflict with the
    previous timing.

upgrade

  • Breaking

    UpgradeAdapter is no longer available. Use
    upgrade/static instead

zone.js

  • Breaking

    IE/Non-Chromium Edge are not supported anymore.

Deprecations

http

  • Deprecated

    HttpResponseBase.statusText is deprecated

common

CommitTypeDescription
c795960adafeatAdd experimental support for the Navigation API (#63406)
9eac43cf46featSupport of optional keys for the KeyValue pipe (#48814)
a1868c9d13featupdate to cldr 47 (#64032)
196fa500a3fixproperly type ngComponentOutlet (#64561)
7a4b225c57refactorimprove typing of ngComponentOutletContent (#63674)
25f593ce2arefactorremovengModuleFactory input of NgComponentOutlet (#62838)

compiler

CommitTypeDescription
ecea909bccfixdon't choke on unbalanced parens in declaration block
04dd75ba94fixsupport arbitrary nesting in :host-context()
f54cc4f28afixsupport commas in :host() argument
814b2713f5fixsupport complex selectors in :nth-child()
aad6ced0effixsupport one additional level of nesting in :host()

compiler-cli

CommitTypeDescription
563dbd998cfeatAdds diagnostic for misconfigured @defer triggers (#64069)
0571b335b9featenable type checking of host bindings by default (#63654)
5b55200edffixallow value to be set on radio fields
ab98b2425ffixcapture metadata for undecorated fields (#63957)
be7110342bfixdisallow compiling with the emitDeclarationOnly TS compiler option enabled (#61609)
bd322ca410fixdo not flag custom control required inputs as missing when field is present
471da8a311fixinfer type of custom field controls
96cb0cffdafixinfer types of signal forms set on native inputs
71ab11ccf0fixmake field detection logic more robust
1f389b8b97fixmissingStructuralDirective diagnostic produces false negatives (#64579)
7fd3db0423fixremove internal syntax-related flags (#63787)
c371251e4cfixreport invalid bindings on form controls
01290ab275fixuse any when checking field interface conformance

core

CommitTypeDescription
809a4ed8c1featAdd migration for zoneless by default. (#63042)
2a7a5de53ffeatAllow passing application providers in bootstrapModule options (#64354)
28926ba92cfeatintroduce BootstrapContext for improved server bootstrapping (#63562)
c2d376b85afeatmake SimpleChanges generic (#64535)
ad2376435bfeatsupport IntersectionObserver options in viewport triggers (#64130)
539717f58afeatsupport regular expressions in templates (#63887)
ab415f3d7ffixcontrol not recognized when input has directive injecting ViewContainerRef (#64368)
f008045dedfixdo not rename ARIA property bindings to attributes (#63925)
1352fbdbf2fixDrop special-case disables automatic change detection scheduling (#63846)
c0791e1887fixdrop support for TypeScript 5.8 (#63589)
aa389a691bfixensure @for iteration over field is reactive (#64113)
fec7c288e9fixError on invalid APP_ID (#63252)
d399d7d02bfixExplicit Zone CD in TestBed providers should not override TestBed error handler (#63404)
92e09adc0afixRemove ignoreChangesOutsideZone option (#62700)
45fed3d201fixRemove Zone-based change provider from internals by default (#63382)
c9f977833efixskip Angular formatting when formatting signals recursively
67fbd5ff1efixSSR error in signal forms
c241038111fixupdate symbols (#64481)
a5e5dbbc16refactorremove moduleId from Component metadata (#63482)
9a16718b13refactorremove deprecated interpolation option on Components. (#63474)

elements

CommitTypeDescription
be0455addafixreturn value on signal input getter (#62113)

forms

CommitTypeDescription
a278ee358cfeatadd debounce() rule for signal forms
b8314bd340featadd experimental signal-based forms (#63408)
0dd95c503ffeatAdd FormArrayDirective (#55880)
d201cd2c2bfeatPrevents marking fields as touched/dirty when state is hidden/readonly/disabled (#63633)
9c5e969f51fixbind invalid input in custom controls (#64526)
10ef96adb3fixconsistent treatment of empty (#63456)
d89e522a1ffixdebounce updates from interop controls
c0d88c37c9fixEmit FormResetEvent when resetting control (#64024)
94b0afec00fiximplement interoperability between signal forms and reactive forms (#64471)
a1ac9a6415fixinterop supports CVAs with signals (#64618)
505bde1fedfixmark field as dirty when value is changed by ControlValueAccessor (#64471)
3529877772fixmark field as dirty when value is changed by a bound control (#64483)
fd9af2afaffixonly propagate schema defined properties from field to control (#64446)
91d8d55a80fixSet error message of a schema error.
f4d1017c25fixtest that common field states are propagated to controls (#63884)
acd7c83597fixtest that min/max properties are propagated to controls (#63884)
71e8672837fixtest that minLength/maxLength properties are propagated to controls (#63884)
507b3466eeperfimplement change detection for field control bindings
781a3299f9perfonly update interop controls when bound field changes
32f86d35f7perfoptimize [field] binding instructions (#64351)

http

CommitTypeDescription
2739b7975bfeatadd referrerPolicy option to HttpResource (#64283)
07e678872ffeatAdd reponseType property to HttpResponse and HttpErrorResponse (#63043)
5cbdefcf11featadd support for fetch referrerPolicy option in HttpClient (#64116)
4bed062bc9featProvide http services in root (#56212)
0e4e17cd97refactorHttpResponseBase.statusText (#64176)

language-server

CommitTypeDescription
3f7111a9c3fixfix directory renaming on Windows

language-service

CommitTypeDescription
89095946cffixaddress potential memory leak during project creation
80e00ff4e5fixprevent interpolation from superseding block braces (#64392)

migrations

CommitTypeDescription
6ddb250391featadd migration to convert ngClass to use class (#62983)
8dc8914c8afeatadd migration to convert ngStyle to use style (#63517)
861cee34e0featAdds migration for deprecated router testing module (#64217)
75fc16b261featAdds support for CommonModule to standalone migration (#64138)
655a99d0c6fixfix bug in ngclass-to-class migration (#63617)
62bbce63b7fixremove error for no matching files in control flow migration (#64253)

platform-browser

CommitTypeDescription
ce8db665f9refactorremove deprecated ApplicationConfig export (#63529)

router

CommitTypeDescription
4e0fc81491featconvert lastSuccessfulNavigation to signal (#63057)
5e61e8d3c3fixFix memory leak through Navigation.abort and canDeactivate guards (#64141)
f6a73f1913fixRespect custom UrlSerializer handling of query parameters (#64449)
5b53535dd1fixUpdate recognize stage to use internally async/await (#62994)

upgrade

CommitTypeDescription
f86846555bfixRemove deprecated UpgradeAdapter (#61659)

A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.