This commit removes the `Compiler` injectee from the `RouterPreloader` constructor. It's unused but was still being referenced in the factory definition: `static ɵfac = ɵɵngDeclareFactory(...)`.
PR Close#60945
This commit wraps the `error` and `unhandledrejection` event listeners so they are installed outside of the Angular zone, because otherwise they trigger change detection whenever the event callbacks are invoked.
PR Close#60944
Adds support for asynchronous redirects in the router, allowing redirect logic to be resolved dynamically (e.g., via API or async function). This enhances routing flexibility and supports more complex navigation scenarios.
BREAKING CHANGE: The `RedirectFn` can now return `Observable` or
`Promise`. Any code that directly calls functions returning this type
may need to be adjusted to account for this.
PR Close#60863
Redirects in the router are handled before `canMatch` guards are evaluated. As a result, `canMatch` will not run for routes that include a redirect. Instead of silently ignoring this misconfiguration, developers should be alerted to help them understand why it doesn't behave as expected.
Closes: #60957
PR Close#60958
This commit moves zoneless from experimental to developer preview.
* Update tag on provider API
* Remove "experimental" from provider name
* Move documentation from "experimental features" to "Best practives ->
Performance" (at least temporarily until there is a better place)
BREAKING CHANGE: `provideExperimentalZonelessChangeDetection` is
renamed to `provideZonelessChangeDetection` as it is now "Developer
Preview" rather than "Experimental".
PR Close#60748
Updates the template binder to account for the new selectorless AST nodes. This is a prerequisite to supporting template type checking of the new syntax.
PR Close#60952
Adds the follow validations to the selectorless template parsing:
* Local references with values are not allowed (e.g. `#foo="bar"`).
* Multiple local references with the same on a component or directive are not allowed.
PR Close#60952
Updates the target binder to allow either a selector-based or selectorless matcher to be passed in. This will allow us to skip some of the overhead when matching directives to nodes.
PR Close#60952
Instead of stabilizing the TestBed.flushEffects() API we intend to
replace it with the tick() method (equivalent of ApplicationRef.tick().
The reasoning here is that we prefer tests running the entire
synchronization process (as in production apps) instead of invoking
parts of the synchronization process in a way that would naver happen
in a running application.
PR Close#60959
This commit adds the support for the `in` keyword as a relational operator, with the same precedence as the other relational operators (<,>, <=, >=)
BREAKING CHANGE: 'in' in an expression now refers to the operator
PR Close#58432
This effectively expands Angular's existing browser support policy to be defined as browsers covered by the "widely available" Baseline (effectively browsers released <30 months ago). Each major version will choose a date shortly before release and pin its version support to the "widely available" Baseline of that date.
For now, I'm arbitrarily picking March 31st as I try to land the general infra and policy change, but we'll likely update the exact date a little closer to the v20 RC.
PR Close#60754
Currently, only forms created with `FormGroupDirective` emit events on
form submission and resetting. This commit extends this behavior to
Template-driven forms also.
Related to #58894
PR Close#60887
The @Attribute decorator will inject null if a host attribute
is missing, but `inject(new HostAttributeToken(...))` will throw
a no provider error. We should set {optional: true} when migrating
an @Attribute decorator. Also allow nonNullableOptional to add
`!` to those declarations.
PR Close#60916
docs: update code snippet
Co-authored-by: Andrew Scott <atscott01@gmail.com>
docs: update link
Co-authored-by: Matthieu Riegler <kyro38@gmail.com>
docs: update syntax highlighting
Co-authored-by: Andrew Scott <atscott01@gmail.com>
docs: correct example links
docs: update load component with more concise syntax
docs: fix link text
docs: fix api docs link formatting
docs: fix callout box types and rendering
docs: truncate properties table
docs: swap constructor routes to use inject instead
docs: add other routing tasks info in subnav and remove duplicate info
docs: fix type conversion param
PR Close#60006
Only require a readonly array as input for router commands instead of a writable array. Router itself does not need writable access to the array of commands. If router requires a writable array somebody on the outside would have to spread a readonly array to a new writable array. We can avoid this by just require what route actually needs.
Fixes#60269
BREAKING CHANGE: Several methods in the public API of the Router which
required writable arrays have now been updated to accept readonly
arrays when no mutations are done.
PR Close#60345