Like `@if`, `@for` and `@switch`, a `@boundary` block copies the tag name
and attributes of its single root node, so the node can be projected into a
specific `ng-content` slot. The `controlFlowPreventingContentProjection`
diagnostic (NG8011) didn't look at `@boundary` blocks though, so an element
next to a second root node was silently projected into the default slot.
`@error` blocks are left out on purpose: they don't copy the tag name and
attributes of their root node, so the diagnostic's suggestions wouldn't apply.
Fixes#71288
`ReadTemporaryExpr.isEquivalent()` didn't take the expression it was
compared against and compared its own `xref` with itself, so a temporary
read was considered equivalent to any expression, including reads of other
temporaries and unrelated expressions like literals.
Compare against the given expression instead, like the other IR
expressions do: it's only equivalent to a read of the same temporary.
No miscompilation is known to be caused by this, since temporaries are
usually converted to variables before expressions are compared, but the
result was wrong for any caller that compared them earlier.
(cherry picked from commit 3aaf026486)
Previously, computeStandaloneComponentScope called verifyStandaloneImport inside a try/catch block to check whether an imported type was standalone or an NgModule. In JIT mode with ngDevMode=false, verifyStandaloneImport is the first place that reads the lazy definition getter (e.g. ɵdir) of an imported directive, which triggers JIT compilation of that directive. Any compilation error thrown while compiling the imported directive (such as an invalid host binding like @HostBinding('attr.onclick')) was caught by the try/catch block and silently swallowed by poisoning the scope instead of surfacing the error.
Check isNgModule and isStandalone directly (matching computeNgModuleScope) so that compilation errors thrown when evaluating imported definitions are not swallowed.
(cherry picked from commit 54acced1d7)
Please note that this change addresses a **real** production issue
observed, rather than a speculative issue identified through
AI-assisted code analysis.
There is no open issue because most people never put two apps with the
same APP_ID on one page.
Prior to this commit, if you bootstrap 2 apps simultaneously, i.e. a
real app + a widget coming from a CDN (the code we don't have control
of, but we only configure the app name in their settings):
```text
TypeError: Cannot read properties of undefined (reading 'c')
```
With this fix, the code no longer fails with a raw type error. It warns
with code NG0511 instead. It does not crash explicitly, because that
might break whenStable().
(cherry picked from commit 3a0835b332)
Previously, the blur and input listeners in nativeControlCreate were
registered via host.listenToDom(), which routes through wrapListener and
calls markViewDirty before running the callback. This caused
scheduler.notify() to fire on every blur event, even when the control was
already touched and the signal write was a no-op.
Switch to native addEventListener so that change detection ticks are only
triggered by actual signal changes. Remove the now-unused listenToDom
method from ControlDirectiveHost and its implementation.
(cherry picked from commit 6d36d6c097)
Only the synchronous part of a route `resources` function runs in an
injection context, so the example that created `resource()` after
`await import(...)` failed the navigation with NG0203. Capture the
injector before the `await` and pass it to the resource.
(cherry picked from commit cbbe89c4d2)
The Node.js server sample registers its handler with `app.use('*', ...)`,
which Express 5 rejects with "Missing parameter name". Use the same
pathless handler that new projects generate.
`getPrerenderParams` returns `Promise<Record<string, string>[]>`, so the
ids in its examples are strings.
(cherry picked from commit 3ed4a07b24)
Add a callout explaining that `fixture.changeDetectorRef` belongs to the host view, so its `markForCheck()` does not refresh the template of `OnPush` components. Also update the developer skill and AGENTS.md to prefer signals in tests.
Fixes#71293
(cherry picked from commit 2136a25961)
`FormRoot` only calls `submit()` when the form was created with a
`submission` option; otherwise it only prevents the default browser
submission. Also document that `submit()` resolves to `false` when a
submission is already in progress, and rejects when the action throws.
(cherry picked from commit 40bb6df6d8)
The API reference only attaches a `@param` description to a parameter
when the names match. Several APIs documented parameters under a
different name than the one in the signature, so angular.dev rendered
those parameters with an empty description.
Update the JSDoc to use the actual parameter names:
- core: `ViewContainerRef.move()` documented `index` instead of
`currentIndex`.
- core: `inject()` still documented the `flags` parameter, which was
replaced by `options` when `InjectFlags` was removed from the public
API. Use the same description as the other `inject()` overloads.
- core: `twoWayBinding()` documented `eventName` instead of `publicName`.
- common: `Location.subscribe()` documented `value` and `exception`
instead of the `onNext` and `onThrow` callbacks, and didn't document
`onReturn`.
- common/upgrade: `UrlCodec.encodeSearch()`, `decodeSearch()`,
`encodeHash()` and `decodeHash()` documented `path` instead of
`search` or `hash`, and the first `normalize()` overload documented
`path` instead of `href`. Also fix a "has string" typo.
- router: `DefaultTitleStrategy.updateTitle()` documented a `title`
parameter instead of `snapshot`. Also update its description, since
it builds the title from the router state rather than setting a
given value.
- forms: `minDate()` and `maxDate()` documented `minDate` and `maxDate`
instead of `minDateValue` and `maxDateValue`.
Verified by rebuilding the docs with `//adev:build` and checking that
each of these parameters now has a description in the generated API
reference pages, and that no other `@param` name mismatches remain
besides `IterableChanges.forEachOperation` (which documents its
callback's arguments) and the `QueryList` constructor.
(cherry picked from commit 6e024600e0)
A date input reads and writes `Date` values at midnight UTC, which is how
`valueAsDate` behaves. `minDate` and `maxDate` compare against that value
and format the `min` and `max` attributes with UTC getters, so a limit built
from local time (`new Date(2026, 5, 1)` or `new Date()`) is shifted by the
user's UTC offset. Depending on the time zone, the limit date itself is
rejected or the attribute is a day off.
Add a `minDate() and maxDate()` section to the validation guide, which had
none, and note the UTC contract in the JSDoc of `minDate` and `maxDate`.
Point the `@see` links of those two functions at the new section.
(cherry picked from commit 2a66275511)
getUniqueIdForProperty called id.replace(/\.d\.ts$/, '.ts') and dropped
the result, so an @Output seen through a .d.ts got a different ID than
the same output in its .ts source. The signal input and signal queries
migrations already assign the normalized ID.
Claude-Session: https://claude.ai/code/session_01W9Mk18mBNfkPfgg3hYweKq
(cherry picked from commit baa916d129)
The parameter encoding was using a plain object literal lookup to determine how to encode specific characters. This makes it vulnerable to prototype pollution.
These changes mitigate the issue by storing the mapping in a native `Map` instead.
(cherry picked from commit 01c883e2b6)
Several tutorial steps tell the reader to do something that does not
match the starting code or the answer, so following them literally
breaks the app or shows the wrong result.
- signals: read userStatus() first in isWithinWorkingHours so the
computed always tracks it, align the step 5 update method with the
answer, and explain that the step 10 timer effect reads no signals
- learn-angular: fill in the existing showSecretMessage() stub, keep the
placeholder and loading blocks in the viewport snippet, drop the
RouterOutlet import the starter already has, link `fill` to the image
guide, close the last step of the pipe tutorial properly, and drop the
version mention from the NgIf and NgFor notes
- first-app: import HousingLocationInfo in step 5, move baseUrl with
the data in step 9, link property binding to the right section, and
correct stale snippet ranges and a few instructions
- playground: listen for touchcancel in the minigame
(cherry picked from commit 4044cef046)
The NG05201 page said the error is thrown when binding an untrusted value
to a resource URL attribute such as `<iframe [src]>`, but template and
host bindings are checked by core and throw NG0904. NG05201 only comes
from calling `DomSanitizer.sanitize()` with `SecurityContext.RESOURCE_URL`.
Rewrite the page around the direct `sanitize()` call, link to NG0904 for
bindings, align its structure with the NG0904 page, and add NG05201 to
the errors overview.
(cherry picked from commit d63eb750ac)
The compat FormGroup example never passed the `required` schema shown in
the migration guide, so its "Customer name is required." message could
never appear in the live preview. The FormControl example's comment also
claimed the email value was "angular_user" while the model starts empty.
(cherry picked from commit 82227492b8)
The update guide rendered its "nothing to do" messages with an `@if` on the list length placed after each `@for` loop. Use the loops' built-in `@empty` blocks instead. No behavior change.
(cherry picked from commit ff202d32d4)
Replaces direct `ActivatedRoute` usage with routed component input binding for query params and resolved route data. Keeps `ActivatedRoute` only where it is still needed for relative navigation.
(cherry picked from commit 7c42c4be77)
Ignore the canvas onpaint property when asserting that element properties are patched. Newer versions of Chromium implement the experimental WICG HTML-in-Canvas specification which introduces onpaint on HTMLCanvasElement.prototype. Because zone.js is in maintenance mode and onpaint is experimental, zone.js does not patch this property.
(cherry picked from commit 01bb8cdb5d)
Adds some logic to inline the TCB when depending on a directive in the same file that isn't exported.
Fixes#71291.
(cherry picked from commit 0a77018368)
Comments are replaced with a placeholder before the styles are scoped. A
comment that is placed inside of a selector, e.g. `.a /* comment */ {}` or
`.a, /* comment */ .b {}`, ended up as its own selector part and got the
content attribute appended, which changed what the rule matches (e.g.
`.a[c] [c] {}` and `.a[c], [c] .b[c] {}`).
Parts that only consist of comment placeholders are now left untouched.
(cherry picked from commit 8acf703db6)
Fixes an injection error that was being thrown when an embedded view tih animation is destroyed while destroying its `ApplicationRef`.
Fixes#71254.
(cherry picked from commit 97f8b6af93)