14564 Commits

Author SHA1 Message Date
Jessica Janiuk a0361b3ae2 Revert "refactor(core): remove ng when invoking enableProdMode"
This reverts commit cb5879f566.

(cherry picked from commit e673eb6df2)
2026-01-14 16:09:02 +00:00
Matthieu Riegler 492b10686b refactor(core): remove ng when invoking enableProdMode
This was caught while investigating a leak.

(cherry picked from commit cb5879f566)
2026-01-13 19:39:52 +00:00
Jeremy Elbourn 01e5babdf6 docs: update OnChanges API reference w/ signal input
We had some reports of LLMs claiming that `ngOnChanges` does not include
changes for signal-based inputs. This is wrong (and the LLMs just made
it up), but we can update the docs at least to demonstrate `ngOnChanges`
with signal-based inputs.

Previously, the API reference used a real test as a code example, but
updating the test to a signal-based input is more involved than this
change needs to call for.

(cherry picked from commit 871fa1b2dd)
2026-01-13 17:04:27 +00:00
Matthieu Riegler 82d556a8fb fix(forms): Ensure the control instruction comes after the other bindings
Prior to this change, binding to radio value was sensitive to the order in which `value` & `formField` where binding in the template.
The compiler change makes that order non-important.

fixes #66402

(cherry picked from commit 65fa5b5439)
2026-01-12 21:49:23 +00:00
cexbrayat 5cbb66fdf2 test(forms): improve test coverage for multiple pattern validators
Add comprehensive test cases to validate behavior when multiple
pattern validators are applied to the same field.

These tests clarify that multiple patterns operate with AND logic,
where each pattern is validated independently and produces its own
error when it doesn't match.

(cherry picked from commit 7fd076bdd3)
2026-01-12 21:48:19 +00:00
Shuaib Hasan Akib 6a9d4d5458 docs: replace old https://angular.io/license with https://angular.dev/license
(cherry picked from commit 1b4dcc01ff)
2026-01-12 21:41:34 +00:00
SkyZeroZx a1dea3e736 refactor(http): remove redundant providedIn: 'root' in XSRF_HEADER_NAME
Removes unnecessary `providedIn: 'root'` declarations from injection token

(cherry picked from commit e38c1bf743)
2026-01-12 18:00:29 +00:00
SkyZeroZx e72e136096 refactor(core): Add missing OnDestroy to zone and zoneless change detection schedulers
Implements the OnDestroy interface in NgZoneChangeDetectionScheduler and ChangeDetectionSchedulerImpl

(cherry picked from commit fa6e82b569)
2026-01-12 18:00:28 +00:00
SkyZeroZx 615a77b685 refactor(compiler-cli): update error message links to versioned docs (#66374)
Error message links now point to the archived documentation site (v*.angular.dev)
so that referenced content matches the framework version in use.

See angular#44650

PR Close #66374
2026-01-09 22:33:52 +00:00
SkyZeroZx 450b4c1e90 refactor(core): update error message links to versioned docs (#66374)
Error message links now point to the archived documentation site (v*.angular.dev)
so that referenced content matches the framework version in use.

See angular#44650

PR Close #66374
2026-01-09 22:33:51 +00:00
Miles Malerba 0055f3cc79 fix(forms): Rename signal form [field] to [formField]
This completes the rename started in #66136. `[field]` is too generic of
a selector for the forms system to own, and likely to cause naming
collisions with existing components. Therefore it is being renamed to
`[formField]`

(cherry picked from commit 5671f2cc07)
2026-01-09 22:33:13 +00:00
tomer953 e4bfa5c9e7 fix(migrations): prevent duplicate imports in common-to-standalone migration
The common-to-standalone migration did not check for existing imports
when adding needed imports after removing CommonModule. This change adds deduplication
logic to filter out imports that already exist in the imports array
before adding them, ensuring each import appears only once.

(cherry picked from commit 008e20ca56)
2026-01-09 22:30:52 +00:00
fisker 018edd5566 refactor(compiler): switch Binary.isAssignmentOperation to type guard function
Improve `Binary.isAssignmentOperation` types

(cherry picked from commit 4fb24cadee)
2026-01-09 17:59:32 +00:00
kirjs 24fa4a2460 docs(forms): Clarify returning errors from submit functions
Update outdate comment, and add a section to the docs

(cherry picked from commit 7d985ce08e)
2026-01-09 16:47:46 +00:00
fisker 3033568bb4 refactor(compiler): tighten Unary.operator type
Improve `Unary.operator` type

(cherry picked from commit a7e470a1b3)
2026-01-09 16:47:04 +00:00
fisker 418326839a refactor: _ParseAST.isAssignmentOperator to type guard
Update `_ParseAST.isAssignmentOperator` to type guard

(cherry picked from commit 4d19408e9b)
2026-01-09 16:45:39 +00:00
fisker 9b97a1dfa3 refactor(compiler): tighten Binary.operation type
Improve `Binary.operation` types

(cherry picked from commit 07a08ab9f8)
2026-01-09 16:45:39 +00:00
Andrew Scott 696adbca5f refactor(core): Use the provided Document value rather than global in FakeNavigation
This commit ensures the Document used by `FakeNavigation` is the one
passed in the constructor rather than the global `document`, which may
be different.

(cherry picked from commit 49295778bc)
2026-01-08 21:28:23 +00:00
Andrew Scott 5239e471a1 fix(core): handle cancelled traversals in fake navigation
Update fake navigation implementation to correctly handle traversals that are cancelled (e.g. by a precommit handler).
Ensure prospective index is calculated correctly so that subsequent traversals target the correct entry.
Add regression test for cancelled traversals.

(cherry picked from commit 86dc1283e8)
2026-01-08 19:27:41 +00:00
Angular Robot 8aab227960 build: update cross-repo angular dependencies
See associated pull request for more information.
2026-01-08 08:41:59 -08:00
Jaime Burgos f5bad8e417 refactor(core): Improve tree-shakable RuntimeError error for INVALID_FIELD_DIRECTIVE_HOST
Improves the tree-shakable runtime error handling for `INVALID_FIELD_DIRECTIVE_HOST`.

(cherry picked from commit 5c75d29fb4)
2026-01-07 22:32:29 +00:00
Jessica Janiuk a6a2621bf9 fix(core): fix memory leak with event replay
This ensures event replay does not hold on to elements after an application has been destroyed.

fixes: #59261
(cherry picked from commit 30e9c62bdf)
2026-01-07 22:27:47 +00:00
Leon Senft ff531752b0 refactor(forms): remove customError()
Remove the `customError` function and `CustomValidationError` type.

These were made obsolete by support for returning plain object literals
as custom errors.

This also catches few `field` properties that were missed in the
renaming to `fieldTree`.

(cherry picked from commit 46dbd18566)
2026-01-07 15:07:35 -05:00
arturovt 5e9e09aee0 fix(router): handle errors from view transition updateCallbackDone promise
Firefox-specific workaround: Firefox 144+ creates the `updateCallbackDone` promise
internally during error handling (e.g., duplicate view-transition-name), even before
the property is accessed. This can cause unhandled promise rejections to appear in
error tracking tools like Rollbar/Sentry. We must attach catch handlers to all three
promises immediately to prevent these unhandled rejections.
See: https://bugzilla.mozilla.org/show_bug.cgi?id=1999336 (if applicable)
Spec: https://drafts.csswg.org/css-view-transitions-1/#dom-viewtransition-updatecallbackdone

(cherry picked from commit 9e043decaf)
2026-01-07 15:06:02 -05:00
Kristiyan Kostadinov fbb37d8388 refactor(core): remove unused instruction parameter
The `thisArg` in pure functions isn't used so we can drop it. We still need to keep it on the underlying implementation, because pipe instructions rely on it.

(cherry picked from commit 4dc5ae54a9)
2026-01-07 15:05:24 -05:00
SkyZeroZx 8aa77557f1 docs: update angular.io links to angular.dev in comments, TSDoc, and warnings
(cherry picked from commit b2f417585a)
2026-01-07 14:12:18 -05:00
Andrew Scott 41cd4a6af8 fix(router): Fix RouterLink href not updating with queryParamsHandling
There was a bug introduced in #60875. While RouterLink doesn't
necessarily depend on Router state, its link can change when navigations
cause the `ActivatedRoute` paths to change. It is difficult to determine
which segments the link depends on. Luckily, the commit had flawed
logic:

```
!this.queryParamsHandling && !dependsOnRouterState(this.options?.defaultQueryParamsHandling);
```

The subscription gets created whenever `queryParamsHandling` was not
defined, or it was non-default. This is pretty much all scenarios since
nobody is likely to set it explicitly to the default value. In addition,
the `click` handler recomputes the tree because `urlTree` is a getter
that does the computation.

This commit effectively rolls back #60875

(cherry picked from commit bcef77d950)
2026-01-07 14:08:17 -05:00
SkyZeroZx ae1dc16bb0 fix(forms): clean up abort listener after timeout
Removes the abort event listener once the debounce timeout completes.

This avoids lingering listeners, prevents potential memory leaks, and ensures
the abort logic runs at most once.

(cherry picked from commit e7d99f02cb)
2026-01-07 14:07:28 -05:00
Kristiyan Kostadinov 63b1cdcf70 fix(compiler): produce accurate span for typeof and void expressions
Fixes that the `typeof` and `void` expressions were starting their spans from the expression start, rather than the keyword.

Fixes #66174.

(cherry picked from commit 3a56c1367f)
2026-01-07 14:04:09 -05:00
Kristiyan Kostadinov 7c74674eb0 fix(core): avoid leaking view data in animations
The animations code currently tracks which views have running leave animations by adding them to a `Set`. This can leak memory if we don't clean something up on time.

These changes switch to tracking the views by their ID which doesn't risk retaining the view.

Fixes #66255.

(cherry picked from commit 80b0fbba1f)
2026-01-07 12:39:04 -05:00
hawkgs c1e9627f6d docs(core): fix Ivy view data docs tables
The current formatting prevents the tables to be rendered making it hard to read them.

(cherry picked from commit 51ed487fae)
2026-01-07 09:22:47 -05:00
SkyZeroZx d699eef2ca docs: add docs for transform property in built-in loaders
(cherry picked from commit 3dfdb71d65)
2026-01-07 09:18:03 -05:00
Andrew Scott 4161161320 Revert "fix(router): Ensure createUrlTree does not reuse segments of input"
This reverts commit 39efb62c0f.

(cherry picked from commit 174d2da29a)
2026-01-07 00:29:22 +00:00
Miles Malerba e3fba182f9 feat(forms): add [formField] directive
This will replace the `[field]` directive, since `[field]` is a very
generic name for signal forms to commandeer

refactor(forms): hook up `formField` directive in compiler

Hooks up the `formField` direcive to get the same treatment as the
`field` directive in the compiler.

apply updated formatting

(cherry picked from commit 2d85ae5811)
2026-01-06 17:21:09 -05:00
Leon Senft af1d4acb9d refactor(forms): bind native properties on interop controls
The framework will now bind all field state properties to their
corresponding native properties (if any) on interop form controls (those
using `ControlValueAccessor`), excluding those handled explicitly by
`ControlValueAccessor` such as `disabled`.

(cherry picked from commit 82a2de201f)
2026-01-06 13:12:21 -05:00
Leon Senft 0e8b9d8cde refactor(forms): bind field properties to all directives on interop controls
The framework will now bind the field state properties to all matching
directive inputs on form controls using Reactive Forms'
`ControlValueAccessor`.

(cherry picked from commit 15bddbdcda)
2026-01-06 13:12:21 -05:00
Leon Senft ff37a13913 refactor(forms): bind field properties to all directives on custom controls
The framework will now bind the field state properties to all matching
directive inputs on custom form controls.

(cherry picked from commit 0c8f15d546)
2026-01-06 13:12:21 -05:00
Leon Senft a4ba820d36 refactor(forms): bind field properties to all directives on native controls
Since the `Field` directive manages binding `FieldState` properties to
the underlying form control automatically, the type checker prohibits
explicit bindings to the same properties to avoid conflicts. This proved
problematic in cases where developers wanted to bind these properties to
the inputs of other directives on form controls. Now the framework will
bind the field state properties to all matching directive inputs on
native controls.

Fix #65617

(cherry picked from commit c149f47ef6)
2026-01-06 13:12:21 -05:00
Andrew Scott 92c162e1b9 fix(router): Ensure createUrlTree does not reuse segments of input
Mutating the `UrlTree` that is returned by `createUrlTree` can cause the
input, which might even be an active route, to be mutated. This ensures
the `UrlSegment`s are recreated and do not mutate the input.

fixes #54624

(cherry picked from commit 39efb62c0f)
2026-01-06 13:11:58 -05:00
Kristiyan Kostadinov 8e808740c9 fix(compiler): better types for a few expression AST nodes
We had `any` types for `LiteralArray.expressions`, `Chain.expressions`, `BindingPipe.args`, `LiteralPrimitive.value` and `LiteralMap.values`. These changes add proper types to them.

(cherry picked from commit 10da2f9029)
2026-01-06 12:16:32 -05:00
Alan Agius f9c29572d2 fix(core): sanitize sensitive attributes on SVG script elements
This commit updates the DOM security schema and sanitization logic to properly recognize and sanitize `href` and `xlink:href` attributes on SVG `<script>` elements.
2026-01-06 12:16:03 -05:00
Shuaib Hasan Akib 45bfd824bf docs(forms): add documentation links to Signal Forms API
Add @see JSDoc tags to Signal Forms API functions and classes to link to the essentials guide and detailed documentation pages. This improves discoverability of Signal Forms documentation from the API reference.

(cherry picked from commit b93d5ec27a)
2026-01-06 10:34:49 -05:00
Matthieu Riegler a119427834 docs: rewrite testing docs
Those rewrites focus on using Vitest instead of jasmine, drop usages of `fakeAsync`, present modern testing strategy that rely on `whenStable` more than explicit calls to `detectChanges`.

fixes #42748, #48510, #64962, #65987, #66029,  #66150

(cherry picked from commit 71cde39ff0)
2026-01-05 19:38:27 -05:00
Shuaib Hasan Akib e21076d068 docs(forms): fix duplicate validator reference titles in AbstractControl
The removeValidators and hasValidator methods both had identical "Reference to a ValidatorFn" section titles, causing duplicate entries in the API documentation table of contents.

(cherry picked from commit 456ca35906)
2026-01-05 19:26:34 -05:00
SkyZeroZx 8f26a52aa8 refactor(core): introduce tree-shakeable runtime error codes for NgModule handling and ViewContainerRef errors
Adds new tree-shakeable runtime error codes to improve error reporting for
NgModule resolution issues (duplicate or missing IDs) and invalid ViewContainerRef
operations involving destroyed views.

(cherry picked from commit 1532be9d00)
2026-01-05 16:52:27 -05:00
SkyZeroZx cc067c2a0d feat(docs-infra): Extracts aliases from doc entries
Implements a mechanism to extract alias names from a directive's selector.

(cherry picked from commit ed7bfb3c88)
2026-01-05 12:33:19 -05:00
SkyZeroZx 6cfbc736b4 docs: update tsDoc code examples to use TypeScript syntax highlighting
(cherry picked from commit b735c45974)
2026-01-05 12:31:47 -05:00
SkyZeroZx c1f22a3fa4 docs: Add form control state management and event options
(cherry picked from commit b1a0d1d8e2)
2026-01-05 12:16:14 -05:00
SkyZeroZx 06109f5ad3 docs: add @see links to API docs for better discoverability
(cherry picked from commit fa430bffb0)
2026-01-05 12:12:28 -05:00
SkyZeroZx 5e6a9ba2af refactor(router): Simplifies unsubscribe logic
Uses optional chaining to simplify unsubscribe handling.
Also improving tree-shaking by limiting injector names to route paths using `ngDevMode`

(cherry picked from commit 712d8f41e8)
2026-01-05 12:08:14 -05:00