-
Notifications
You must be signed in to change notification settings - Fork 26.3k
feat(compiler): support void and exponentiation operators in templates #59894
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
d7f461c
to
a797765
Compare
d62bfeb
to
7fc4efe
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall LGTM. Given that void
is a new kind of expression, I think we need a few language service tests as well. E.g. that quick info and going to definition works when targeting the expression.
Added the recommended tests |
Add support for the `void` operator in templates and host bindings. This is useful when binding a listener that may return `false` and unintentionally prevent the default event behavior. Ex: ``` @directive({ host: { '(mousedown)': 'void handleMousedown()' } }) ``` BREAKING CHANGE: `void` in an expression now refers to the operator Previously an expression in the template like `{{void}}` referred to a property on the component class. After this change it now refers to the `void` operator, which would make the above example invalid. If you have existing expressions that need to refer to a property named `void`, change the expression to use `this.void` instead: `{{this.void}}`.
Adds support for the exponentiation (`**`) operator in templates Ex: ``` @component { template: '{{2 ** 3}}' } ```
This PR was merged into the repository by commit f2d5cf7. The changes were merged into the following branches: main |
Adds support for the exponentiation (`**`) operator in templates Ex: ``` @component { template: '{{2 ** 3}}' } ``` PR Close #59894
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Add support for the
void
operator in templates and host bindings.This is useful when binding a listener that may return
false
andunintentionally prevent the default event behavior.
Ex:
Also adds support for the exponentiation (
**
) operatorEx:
BREAKING CHANGE:
void
in an expression now refers to the operatorPreviously an expression in the template like
{{void}}
referred to aproperty on the component class. After this change it now refers to the
void
operator, which would make the above example invalid. If you haveexisting expressions that need to refer to a property named
void
,change the expression to use
this.void
instead:{{this.void}}
.