38898 Commits
Author SHA1 Message Date
Alex Rickabaugh d881689d13 release: cut the v22.2.5 release v22.2.5 2026-11-06 11:37:03 -08:00
Alex Rickabaugh 78220d3cc8 test(core): fix cherry-picked attr.src tests on 22.2.x
PR #71799 cherry-picked tests using `signal` and `await fixture.whenStable()` onto `22.2.x`, where `signal` was not yet imported and `describe('attribute binding')` still configures `provideZoneChangeDetection()`. Import `signal` and use `fixture.detectChanges()` to match the rest of the suite on `22.2.x`.
2026-11-05 09:49:56 -08:00
Shuaib Hasan Akib 8c7e5ff9dc docs: use index.csr.html as the SPA fallback for prerendered apps
With `outputMode: "static"` and prerendering, the CLI writes the host page
to `index.csr.html` and `index.html` is the prerendered home page. Pointing
the fallback at `index.html` serves the home page's HTML for every route
that wasn't prerendered. Add a note to the fallback section.

(cherry picked from commit 939171c6f9)
2026-11-04 18:50:13 +00:00
Kam 7b62cb8876 docs(router): fix the router outlet name note
The guide and the RouterOutlet API docs both say the outlet name cannot
be set or changed dynamically. The name has been an input since #46569,
and ngOnChanges moves the outlet to the new name when it changes.

When the value changes, the outlet destroys its current component and
renders the route for the new name, if one matches. Describe that
instead.

(cherry picked from commit 2af465b71f)
2026-11-03 16:43:38 -08:00
akshaywadatkar 6a3b4e0d73 docs: link MDC migration guide in Material v17 update step
Mention running the mdc-migration schematic for apps still using legacy Material components, link the v17 MDC migration guide, and point the v15 step at the version-pinned guide since the rc link now redirects to the guides list.

(cherry picked from commit ee7f788e4e)
2026-11-03 16:40:09 -08:00
Matthieu Riegler ca3afffbdc fix(core): remove attribute when img/video attr.src is null or undefined
The workaround introduced in #71095 converted `null` and `undefined` to `''` in `unwrapImgVideoSrcValue()`. While this coercion is needed for DOM property bindings (`[src]`) to prevent browsers from stringifying `undefined` to `"undefined"`, it inadvertently affected attribute bindings (`[attr.src]`).

In the attribute binding path, coercing `null`/`undefined` to `''` causes `<img [attr.src]="null">` to set `src=""` on the element rather than removing the attribute via `removeAttribute()`. In standard HTML, `<img src="">` causes the browser to trigger an `(error)` event on the element, breaking patterns relying on omitting the `src` attribute until a URL is available.

This commit updates `unwrapImgVideoSrcValue` to accept an `isAttribute` flag and only coerces `null`/`undefined` to `''` for property bindings. Attribute bindings continue to unwrap bypassed safe values while preserving `null`/`undefined` so that `setElementAttribute()` removes the attribute.

(cherry picked from commit d0bef2c605)
2026-11-03 16:39:04 -08:00
Kam 43bad26b73 docs: fix the ng-container binding note in the templates guide
The guide said Angular ignores all attribute bindings and event listeners
on ng-container. The compiler now rejects attribute bindings on it, and a
directive host attribute binding fails at runtime. Property bindings only
work for directive inputs, and unknown ones are reported as errors.

Class bindings, style bindings, DOM event listeners and static attributes
are still ignored, so describe each case.

(cherry picked from commit b223af6b84)
2026-11-03 16:38:34 -08:00
naoki 26e622373f refactor(platform-browser): remove unused cached head field
Remove the unused private _cachedHead field from Meta. The service
never reads or writes this field and accesses the document head directly.

(cherry picked from commit 57c7a8d1a0)
2026-11-03 16:38:00 -08:00
hawkgs fcd82c4326 refactor(core): use official webmcp-types
Vendor the official `webmcp-types` instead of `@mcp-b/webmcp-types`.

Fixes #71268
2026-11-03 16:29:35 -08:00
Максим Иванов 96b027ebf6 perf(forms): avoid creating unused field injectors
Create field injectors only when managed metadata needs an injection
context, and destroy only injectors that have already been created.
Plain metadata and built-in synchronous rules otherwise allocate an
unused injector per field, including during removal.

Preserve eager managed metadata creation, the shared field injection
context, and teardown of asynchronous validators.

Fixes #71623

(cherry picked from commit 67e5069327)
2026-11-03 16:28:33 -08:00
Amine b41e43bbfd fix(docs-infra): keep focus in the API reference filter
The API reference filter writes its value to the URL on each change. With
the Navigation API integration, each of these navigations ends with the
browser moving focus to the body, so typing `signal` in the filter leaves
`s` and the other keys go to the page.

Pass `focusReset: 'manual'` next to `scroll: 'manual'`, so focus stays in
the filter field. The option isn't in the router's public types on this
branch, hence the cast.
2026-11-03 16:27:21 -08:00
Amine ca42fefa56 fix(router): read focusReset from the navigation extras
With the Navigation API integration, the browser resets focus after each
navigation, so a field that writes its value to the URL as the user types
loses focus after the first key.

The `focusReset` option that fixes this is new public API on main
(#71595), so it can't come to the patch branch. Read `focusReset` from
the navigation extras without adding it to `NavigationBehaviorOptions`,
so angular.dev can pass it in the API reference filter.
2026-11-03 16:27:21 -08:00
Shuaib Hasan Akib 6f06af76c9 fix(core): add debugName option to rxResource
`resource()` and `httpResource()` accept a `debugName` to identify their
signals in Angular DevTools, but `RxResourceOptions` didn't, so passing
one to `rxResource()` was a type error. The options are already
forwarded to `resource()`, so only the type was missing.

(cherry picked from commit afbe39765c)
2026-11-03 16:26:32 -08:00
Kam 99428584e8 docs: fix the Renderer2 server-side rendering note in the DOM APIs guide
Renderer2 uses the same DOM renderer on the server as in the browser and
operates on the server's Domino document, so its DOM manipulation works
during server-side rendering and pre-rendering. Describe the real limit,
which is the missing browser-only APIs in the server DOM.

(cherry picked from commit 73661917e1)
2026-11-03 16:25:48 -08:00
Andrew Scott 585271376a perf(router): run loadComponent and loadChildren in root environment injector (g3-only)
Run Route.loadComponent and Route.loadChildren in the Router's root environment injector rather than the route injector in google3 so that loads can happen in parallel rather than being blocked on lazy providers from loadConfig (https://github.com/angular/angular/pull/70860).

Gated behind `g3-only` / `3p-only` markers so 3p behavior remains unchanged until v23.

(cherry picked from commit cfad3f5854)
2026-11-03 16:21:03 -08:00
Sebastian Barfurth a7b0e8ef9d fix(forms): support updateOn blur and submit for custom FormValueControl
Custom controls implementing `FormValueControl` bound via `[formControl]` or `formControlName` currently bypass `setUpControlValueAccessor`. In `NgControl.ngControlCreate`, incoming values from the custom control model were applied directly to the `FormControl` without checking `control.updateOn`.

This update respects `control.updateOn` by buffering pending values and dirty state when `updateOn` is set to `'blur'` or `'submit'`. Value and validity are committed on `touch` output emissions for `'blur'`, and on form submission for `'submit'`. Programmatic resets also synchronize the reset value to the custom control when pending changes are cleared.

Programmatic `setValue` and `reset` calls now also update `[(ngModel)]` for custom controls, as they do for CVAs.

(cherry picked from commit 401b4f2011)
2026-11-03 16:20:30 -08:00
arshiya tabasum 8c426b6cbc fix(core): escape comment markers which share characters
escapeCommentText matched each disallowed marker as a whole, so a marker that overlaps an already matched one was skipped by the scanner and left unescaped. Match the delimiter together with its context instead, which keeps the matched language identical for the existing cases.

(cherry picked from commit f3c77f1e2b)
2026-11-03 16:19:55 -08:00
Angular Robot 11e7670b72 build: update cross-repo angular dependencies
See associated pull request for more information.
2026-11-02 17:04:24 -08:00
Kam 69e6596dd2 docs: fix the ExpressionChanged notes in the lifecycle hooks guide
Changing state in the content and view hooks does not always throw
ExpressionChangedAfterItHasBeenCheckedError. Content hooks run before the
component's own template is checked, so only state an ancestor's template
has rendered is affected. Signals schedule another pass instead of
throwing, and an OnPush view is skipped by the default check.

(cherry picked from commit 12eb4d0329)
2026-11-02 17:02:42 -08:00
Shuaib Hasan Akib a6a4e838ce docs: update the build system migration guide for current defaults
New applications use `@angular/build`, not `@angular-devkit/build-angular`. Scope the `builderMode` note to the devkit Karma builder, since the `@angular/build` test builders always use the application builder. Note that `module: preserve`, the default for new projects, supports import attributes, and that `ng update` offers the migration on each major update, not only v18.

(cherry picked from commit 12b0e89e7a)
2026-11-02 17:01:39 -08:00
Shuaib Hasan Akib 120c05d672 docs: update builder options in the workspace configuration guide
Several descriptions no longer match the current builders:
- `serve` and `test` use their own options and point at a build
  through `buildTarget`; they don't take the `ng build` options.
- `e2e` and `lint` aren't generated by `ng new`.
- The unit test note about adding styles and scripts to the `test`
  target only applies to Karma. With `@angular/build:unit-test`, global
  scripts need `setupFiles`.
- `security` was missing `allowedHosts` and the `autoCsp` object form,
  and `index` was missing `false` and `preloadInitial`.

(cherry picked from commit 4c7783fb23)
2026-11-02 17:00:51 -08:00
KirtiRamchandani 545eb3d07b fix(forms): reflect required validators in compat fields
Expose `required` from `CompatFieldNode` by deriving a signal from the wrapped control's `hasValidator(Validators.required)` state, using the existing control-status signal helper so validator updates and control swaps are observed.

Fixes #68905.

(cherry picked from commit 97bde8aa6c)
2026-11-02 15:30:28 -08:00
Matthew Beck b23d79df03 release: cut the v22.2.4 release v22.2.4 2026-10-29 10:41:18 -07:00
Angular Robot fae1a796e1 build: update pnpm to v11.28.9
See associated pull request for more information.
2026-10-29 08:19:53 -07:00
Angular Robot e17db3e34c build: update dependency aspect_rules_js to v3.5.2
See associated pull request for more information.
2026-10-29 08:19:31 -07:00
Angular Robot 125bfa6ff8 build: update cypress-io/github-action action to v7.4.8
See associated pull request for more information.
2026-10-29 08:19:11 -07:00
Matthieu Riegler 122663145b fix(forms): reject unsupported updateOn in SignalFormControl
Signal forms are model-driven and do not support pending or uncommitted
values. As a result, non-default `updateOn` options (`blur`, `submit`)
cannot be supported.

This commit adds a dev-mode check in `SignalFormControl` to throw an error
when:
1. An unsupported `updateOn` option is passed directly in options to the
   `SignalFormControl` constructor.
2. A non-default `updateOn` option is inherited from a parent `FormGroup`
   or `FormArray` via `setParent()`.

Additionally, `SignalFormControl` explicitly overrides `get updateOn()`
to return `'change'`.

(cherry picked from commit 9e99093bfe)
2026-10-28 16:46:01 -07:00
Angular Robot 8087f76379 build: update cross-repo angular dependencies
See associated pull request for more information.
2026-10-28 13:31:13 -07:00
Angular Robot e16acdce3c build: lock file maintenance
See associated pull request for more information.
2026-10-28 13:08:15 -07:00
Shuaib Hasan Akib a34fe00154 docs: update generated file names in the ecosystem guides
The web worker, service worker and app shell guides still showed `app.component.*` file names and the old root template text. Use the current names (`app.ts`, `app.html`, `app-shell.ts`), the current root template text, and list the files the generated `ngsw-config.json`
actually caches.

(cherry picked from commit cd9d0aea3f)
2026-10-28 11:41:31 -07:00