Skip to content

fix(compiler): allow $any in two-way bindings#59362

Closed
crisbeto wants to merge 1 commit intoangular:mainfrom
crisbeto:51165/two-way-any
Closed

fix(compiler): allow $any in two-way bindings#59362
crisbeto wants to merge 1 commit intoangular:mainfrom
crisbeto:51165/two-way-any

Conversation

@crisbeto
Copy link
Copy Markdown
Member

@crisbeto crisbeto commented Jan 4, 2025

Some time ago we narrowed down the expressions we support in two-way bindings, because in most cases any apart from property reads doesn't make sense. This ended up preventing users from using $any in the binding since it's considered a function call.

These changes update the validation logic to allow $any.

Fixes #51165.

@crisbeto crisbeto added the target: patch This PR is targeted for the next patch release label Jan 4, 2025
@angular-robot angular-robot bot added the area: compiler Issues related to `ngc`, Angular's template compiler label Jan 4, 2025
@ngbot ngbot bot added this to the Backlog milestone Jan 4, 2025
Some time ago we narrowed down the expressions we support in two-way bindings, because in most cases any apart from property reads doesn't make sense. This ended up preventing users from using `$any` in the binding since it's considered a function call.

These changes update the validation logic to allow `$any`.

Fixes angular#51165.
@angular-robot angular-robot bot added area: compiler Issues related to `ngc`, Angular's template compiler and removed area: compiler Issues related to `ngc`, Angular's template compiler labels Jan 4, 2025
@crisbeto crisbeto added action: merge The PR is ready for merge by the caretaker target: minor This PR is targeted for the next minor release and removed target: patch This PR is targeted for the next patch release labels Jan 6, 2025
@thePunderWoman
Copy link
Copy Markdown
Contributor

This PR was merged into the repository by commit ceadd28.

The changes were merged into the following branches: main

@angular-automatic-lock-bot
Copy link
Copy Markdown

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Feb 6, 2025
PrajaktaB27 pushed a commit to PrajaktaB27/angular that referenced this pull request Feb 7, 2025
Some time ago we narrowed down the expressions we support in two-way bindings, because in most cases any apart from property reads doesn't make sense. This ended up preventing users from using `$any` in the binding since it's considered a function call.

These changes update the validation logic to allow `$any`.

Fixes angular#51165.

PR Close angular#59362
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker area: compiler Issues related to `ngc`, Angular's template compiler target: minor This PR is targeted for the next minor release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Attribute two way binding not working with $any and error is unclear

3 participants