38876 Commits
Author SHA1 Message Date
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
Doug Parker a58723a238 docs: update SECURITY.md
Adding some feedback based on AI security reports to help guide them towards what is and is not a legitimate vulnerability.

(cherry picked from commit 309eaf6b9b)
2026-10-28 11:40:58 -07:00
Angular Robot 31b13fcc46 build: update cross-repo angular dependencies
See associated pull request for more information.
2026-10-28 06:50:57 -07:00
Kam 167c8e2688 docs: document deploying localized apps with prerendering
Add a "Prerendering" section to the i18n deploy guide for apps built with
`outputMode: "static"`. It describes the per-locale output layout, serving
the source locale from the root with `"subPath": ""`, the lack of
`Accept-Language` redirects without a server, and per-locale not-found pages.

Also add a short section to the locale ID guide on reading the active locale
with `$localize.locale` where `LOCALE_ID` can't be injected.

(cherry picked from commit aaa471b799)
2026-10-28 06:50:17 -07:00
Angular Robot bca21ac9a1 docs: update cross-repo adev docs
Updated Angular adev cross repo docs files.
2026-10-27 16:51:46 -07:00
Kam b6abae2010 docs: fix inaccurate null and class notes in the template binding guide
Interpolation renders null and undefined as an empty string instead of
converting them with toString. Attribute bindings remove the attribute for
undefined as well as null. The [class] binding does not drop strings that
are not valid CSS class names, so describe the string form instead.

(cherry picked from commit c35b3ad17b)
2026-10-27 16:51:28 -07:00
Matt Berry 8e700509e5 Revert "fix(docs-infra): keep focus in the API reference filter"
This reverts commit be34a108d6.

#71602 relies on `NavigationExtras.focusReset`, which was added in #71595 (`target: minor`) and only merged into `main`. Reverting on `22.2.x` to fix the release branch build.
2026-10-27 14:08:26 -07:00
Angular Robot 168130217a build: lock file maintenance
See associated pull request for more information.
2026-10-27 06:58:26 -07:00
Amine be34a108d6 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.

(cherry picked from commit 07de4b0234)
2026-10-27 06:57:45 -07:00
Andrew Scott ea8cdc4c6b fix(router): skip split when piercing empty path outlets
`split` is designed to split remaining primary outlet segments alongside
empty-path named outlets (`createChildrenForEmptyPaths` wraps `slicedSegments`
in `res[PRIMARY_OUTLET]`). When piercing an empty-path route to look for a
named outlet among its descendants (`!matchedOnOutlet`), `remainingSegments`
belong to that named outlet rather than `PRIMARY_OUTLET`.

Previously, `split` was called even when `!matchedOnOutlet`, which required
the `isSelfEvaluating` workaround in #67708 to ignore an empty-path route for
the same outlet being evaluated. However, if the pierced empty-path route also
contained another empty-path named outlet sibling (e.g. `tertiary` alongside
`secondary`), `split` still moved `secondary`'s segments into
`children[PRIMARY_OUTLET]` and caused matching to fail.

Skipping `split` when `!matchedOnOutlet` fixes matching when multiple named
outlets exist under an empty-path route and allows removing the `outlet` /
`isSelfEvaluating` workaround from `split`.

Related to #67708

(cherry picked from commit 5048f50268)
2026-10-26 16:05:14 -07:00
Amine 6c631a5359 feat(migrations): migrate static string and array ngClass bindings to class
The ngclass-to-class migration only looked at object literals, so bindings
like `[ngClass]="'first second'"` and `[ngClass]="['first', 'second']"` were
left untouched even though `[class]` accepts exactly the same shapes. See
`toStylingKeyValueArray` in packages/core/src/render3/instructions/styling.ts,
which handles `string | string[] | Set<string> | {[key: string]: any}`.

Both forms are now forwarded to `[class]` unchanged. Detection goes through
the TypeScript parser rather than matching quotes, so an expression that
merely starts and ends with a quote - a ternary, a concatenation - is not
mistaken for a literal and keeps using NgClass.

An array entry containing whitespace is deliberately left alone: NgClass
splits each entry on whitespace, while `[class]` drops any entry containing a
space (see `classKeyValueArraySet`), so `['a b', 'c']` would silently lose
classes. This mirrors the guard the migration already applies to object keys.

Empty arrays keep going through the existing object-literal path, which maps
them to `[class]=""`, so that output is unchanged.

Emitting the replacement now picks the quote character to match the value
instead of always using double quotes. An expression can only contain a
double quote if it came from a single-quoted attribute, in which case it
contains no single quote, so wrapping it in single quotes is always safe.
That lets `[ngClass]='["a", "b"]'` migrate, and it also fixes the existing
object-literal path, which produced invalid HTML for those attributes:

    <div [ngClass]='{"a": isA, "b": isB}'>
    <div [class]="{"a": isA, "b": isB}">        <- before
    <div [class]='{"a": isA, "b": isB}'>        <- after

    <div [ngClass]='{active: mode === "on"}'>
    <div [class.active]="mode === "on"">        <- before
    <div [class.active]='mode === "on"'>        <- after

String literal values in the object-literal path are now kept as written
instead of having their text re-wrapped in single quotes. Re-wrapping broke
as soon as the text contained a double quote, because the value then clashed
with the single quotes picked for the attribute:

    <div [ngClass]='{active: "\"yes\""}'>
    <div [class.active]=''"yes"''>              <- before
    <div [class.active]='"\"yes\""'>            <- after

(cherry picked from commit 9ab611de28)
2026-10-26 16:04:47 -07:00
aparziale 84a398bec2 fix(core): improve the warning for bindings on elements inside ICU expressions
Directives and bindings are not supported on elements inside ICU
expressions, because ICU content is processed at runtime as plain HTML.
Using one anyway, e.g. `<b [title]="title">` inside a plural case, used to
crash with a cryptic `InvalidCharacterError` from `setAttribute`. Since the
ICU attribute allowlist was introduced, such attributes are dropped with a
generic "ignoring unknown attribute name" warning that points to the XSS
security guide, which doesn't tell developers what is actually wrong.

Detect binding-like attribute names (`[prop]`, `(event)`, `*structural`,
`#ref`, `@trigger`) while parsing ICU content and report them in
development mode with a dedicated `NG0700` warning that names the attribute
and the element and explains that only static attributes are allowed
inside ICU cases. The attribute is still ignored, as before.

Fixes #37298

(cherry picked from commit 8523b79bee)
2026-10-26 14:01:57 -07:00
Kam 566e9b681e docs: fix the NgOptimizedImage sizes and decoding notes
NgOptimizedImage prepends auto to sizes only for lazy-loaded images, and
it always sets decoding to sync on priority images, ignoring an explicit
decoding value. The guide implied both applied to every image.

(cherry picked from commit a2ac9567e0)
2026-10-26 12:59:34 -07:00
Angular Robot 12aefc3c8e build: update domino digest to df95632
See associated pull request for more information.
2026-10-26 11:59:58 -07:00
Michael Small 36ad8acc99 docs: update signal in a service names
Co-authored-by: Matthieu Riegler <[email protected]>
(cherry picked from commit 330a9ac909)
2026-10-26 11:43:16 -07:00
Michael Small 28d9c8ff73 docs: add example of signal form model synced to service
Co-authored-by: erKam <[email protected]>
(cherry picked from commit 8e72dfac6e)
2026-10-26 11:43:16 -07:00
Matthieu Riegler 8c4e267080 build(docs-infra): move framework API doc generation targets under //adev
Previously, `generate_api_docs(...)` targets lived directly in each
`//packages/**/BUILD.bazel` file (and `render_api_to_html(...)` in
`//tools/manual_api_docs/{blocks,elements}/BUILD.bazel`). Because
`render_api_to_html` validates links against
`//adev/scripts/routes:defined-routes.json`, running wildcard package
builds or tests such as `bazel test //packages/forms/...` pulled in the
`//adev/...` route generation and API manifest dependency graph across
all packages.

Move all framework `generate_api_docs` and manual API `render_api_to_html`
targets into `//adev/src/content/api` alongside `aria`, `cdk`, and `cli`,
leaving only lightweight `files_for_docgen` filegroups in `//packages/...`
and JSON extraction targets in `//tools/manual_api_docs/...`. Remove the
`generate_api_docs` wrapper from `//tools:defaults.bzl` so neither
`//packages/...` nor `//tools/...` loads or depends on `//adev/...`, and
add `//adev/src/content/api:api_docs_test` so `bazel test //adev/...`
explicitly exercises API doc generation and link validation.

(cherry picked from commit 9bbb7c9d46)
2026-10-26 11:39:04 -07:00
Kam bc4c8e2b73 docs: fix the left shift key event example
The keydown.code.alt.shiftleft example never fires, because Angular adds
the shift modifier to the computed key. Pressing Alt and Left Shift
produces code.alt.shift.shiftleft.

(cherry picked from commit 2e4e1214cc)
2026-10-26 11:38:36 -07:00
Yan Kotliarov be309d5da0 refactor(forms): correct the InputValidityMonitor doc comment
The comment said the service installs a CSS transition and listens
for `transitionstart`. Since it was introduced, the service has
installed `@keyframes` animations and listened for `animationstart`.
Describe what the code does, and rename the private
`createTransitionStyle()` to `createAnimationStyle()` to match.

(cherry picked from commit 4570715712)
2026-10-26 08:32:41 -07:00
Shuaib Hasan Akib 39294fb4c8 docs: generalize the NG0910 error page
NG0910 is also thrown for bindings on SVG animation attributes that
could change an `href`, such as `attributeName`, but the page only
described iframe attributes. Describe the error for any element and
list both cases.

Co-authored-by: Matthieu Riegler <[email protected]>
(cherry picked from commit 960a41d93b)
2026-10-26 08:19:34 -07:00
Yan Kotliarov 61fe5ca816 test(forms): add missing assertions to two signal forms specs
The `debounced()` cycle-error spec had no expectations, and it ended
before the debounced load started, because `debounced()` registers no
pending task. Check the loads and the field's pending and valid state
across the debounce.

The `validateAsync` orphan spec registered abort listeners but never
checked them. Check that removing an item aborts its in-flight load
and leaves the other item's load running.

(cherry picked from commit 95b9765737)
2026-10-26 07:11:50 -07:00
Angular Robot abb467bb45 build: update cross-repo angular dependencies
See associated pull request for more information.
2026-10-26 07:11:20 -07:00
Matthieu Riegler ef020ad70c ci: prevent renovate from update jasmine to v7 for zone.js
Zone.js needs to remain on v6 that is the last one that allows patching.

(cherry picked from commit 857d462b48)
2026-10-26 07:10:23 -07:00