In the case when composing animation classes with `animate.enter` on the
element itself and also with host bindings, the removal would only
have context for one of the classes added: the last one added. This
allows for tracking of the classes added by `animate.enter` via a
WeakMap so we know the exact classes added and which to remove.
Also shores up the tests to make sure we are fully testing animate.enter.
PR Close#62981
Space separated strings, e.g. `class-1 class-2`, should work with both enter and leave animations. `animate.leave` lost that functionality in a refactor. Tests are now added to catch this.
fixes: #62964
PR Close#62979
When animate.leave is used, stylesheet pruning causes issues. Stylesheets with the appropriate animations get pruned before the animations can run. This will delay the removal in the case that the registry is present.
fixes: #62942
PR Close#62943
This adds a test module configuration to define whether animations should be enabled or disabled in test. By default, they are disabled.
PR Close#62764
Currently the HTML parser will stop parsing as soon as it hits an end character in the name of an attribute (e.g. `/` or `>`). This ends up being problematic with some third-party packages like Tailwind which uses a wider range of characters for its class names. While the characters are fine when inside the `class` attribute, our current parser behavior prevents users from setting those classes conditionally through `[class.]` bindings.
These changes adjust the parser to handle such cases.
Fixes#61671.
PR Close#62742
Allow binding to ARIA attributes using property binding syntax _without_
the `attr.` prefix. For example, `[aria-label]="expr"` is now valid, and
equivalent to `[ariaLabel]="expr"`. Both examples bind to either a
matching input or the `aria-label` HTML attribute, rather than the
`ariaLabel` DOM property.
Binding ARIA properties as attributes will ensure they are rendered
correctly on the server, where the emulated DOM may not correctly
reflect ARIA properties as attributes.
Reuse the DOM schema registry from the compiler to map property names in
type check blocks.
PR Close#62630
This commit updates the logic to better handle a situation when there is a cyclic DI dependency detected. Previously, the error message used to contain the name of the token that triggered the problem. With this change, the DI resolution path would also be included, so that it's easier to find and resolve the cycle.
PR Close#50902
Since we know that DOM properties won't go to an inputs, we can move the remapping logic to the compiler, saving us some processing on the client.
PR Close#62421
when marked for traversal the reactive context has to be set to null to avoid inheriting the reactive context of the parent component
PR Closes#61662
PR Close#61663
Previously this would throw an error on the assertLView when we try to discover the templateLView.
Now this properly returns null for the template consumer and continues discovering other effects on the injector.
PR Close#60772
Implements a compiler transform that attempts to statically analyze variable names and apply them to usages of signal functions like signal, computed, effect, etc.
PR Close#57348
In this commit, we switch from using the `isPlatformServer` runtime call to the `ngServerMode`.
Note: constructors haven't been touched in order to prevent any breaking changes for the public API.
PR Close#59496
Replaces the `propertyInterpolateX` instructions with calls to `property` and the `interpolate` helper. This allows us to drop the dedicated interpolation instructions and simplify the runtime for future work.
PR Close#61639
Replaces the attribute interpolation instructions with `attribute` plus the new `interpolateX` instruction. This allows to reduce our overall instruction footprint.
PR Close#61557
Sets up the tests for the selectorless runtime so that we can easily start writing them when we get to it. The tests need to be AoT compiled so they're defined as a separate target from the other `acceptance` tests.
PR Close#61307
Fixes that the runtime was throwing a DI error when attempting to inject a missing `useExisting` provider, despite the call being optional.
The problem was that when the provider has `useExisting`, we do a second `inject` call under the hood which didn't include the inject flags from the original call.
Fixes#61121.
PR Close#61137
This change renames the afterRender to afterEveryRender and marks the
renamed API as stable.
BREAKING CHANGE: afterRender was renamed to afterEveryRender.
PR Close#60999
This commit makes several changes changes to the
`provideExperimentalCheckNoChangesForDebug` API:
* Rename it
* Promote to dev preview
* Apply the exhaustive behavior to _all_ checkNoChanges runs
* Remove `useNgZoneOnStable` option. This wasn't found to be generally
more useful than `interval`
fixes#45612
BREAKING CHANGE: `provideExperimentalCheckNoChangesForDebug` has several
breaking changes:
* It is renamed to `provideCheckNoChangesConfig`
* The behavior applies to _all_ checkNoChanges runs
* The `useNgZoneOnStable` option is removed. This wasn't found to be generally
more useful than `interval`
PR Close#60906
BREAKING CHANGE:
This commit deprecates `ng-reflect-*` attributes and updates the runtime to stop producing them by default. Please refactor application and test code to avoid relying on `ng-reflect-*` attributes.
To enable a more seamless upgrade to v20, we've added the `provideNgReflectAttributes()` function (can be imported from the `@angular/core` package), which enables the mode in which Angular would be producing those attribites (in dev mode only). You can add the `provideNgReflectAttributes()` function to the list of providers within the bootstrap call.
PR Close#60973
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
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
When Angular runs application synchronization automatically, animations
are now guaranteed to be flushed, regardless of whether change detection
was run on any components attached to `ApplicationRef`. This most
frequently affects animations related to component removal where the DOM
element for the component would previously not be removed due to
animations not being flushed
BREAKING CHANGE: Animations are guaranteed to be flushed when Angular
runs automatic change detection or manual calls to `ApplicationRef.tick`.
Prior to this change, animations would not be flushed in some situations
if change detection did not run on any views attached to the
application. This change can affect tests which may rely on the old
behavior, often by making assertions on DOM elements that should have
been removed but weren't because DOM removal is delayed until animations
are flushed.
fixes#58075
PR Close#58089
In this commit, we unsubscribe the `hasPendingTasks` subject to remove all active observers and enable granular garbage collection, as users may forget to unsubscribe manually when subscribing to `isStable`.
PR Close#59723
In this commit, we introduce the ability to check whether `lView` has already been
destroyed in `NodeInjectorDestroyRef`. If the `lView` is already destroyed, we call
the on-destroy callback immediately, without trying to register it to be called later.
This ensures that any necessary cleanup is handled gracefully and provides better
reliability in managing resources.
One of the use cases is `takeUntilDestroyed`, which aims to replace `takeUntil` in existing
applications. While `takeUntil` can be safely called once the view is destroyed—resulting
in no errors and finalizing the subscription depending on whether a subject or replay
subject is used—replacing it with `takeUntilDestroyed` introduces a breaking change, as
it throws an error if the `lView` is destroyed.
Related issue: #54527
PR Close#58008
Practically speaking, this change ensures that Angular is able to make
decisions about what to do when an uncaught error happens.
For tests, this will mean that, by default, the error either causes the
`fixture.whenStable` promise to reject if there is one or rethrow the
error. This ensures tests do not accidentally ignore errors. Opting out
of this can be done with the `rethrowApplicationErrors: false` option in
`TestBed`.
For SSR, there may be additional behaviors in the future that we want to
add, such as redirecting to an error page or responding with a 500
status code.
BREAKING CHANGE: Uncaught errors in listeners which were previously only reported to
`ErrorHandler` are now also reported to Angular's internal error
handling machinery. For tests, this means that the error will be
rethrown by default rather than only logging the error. Developers
should fix these errors, catch them in the test if the test is
intentionally covering an error case, or use `rethrowApplicationErrors:
false` in `configureTestingModule` as a last resort.
PR Close#60251