feat(compiler): support arrow function in template#30277
feat(compiler): support arrow function in template#30277trotyl wants to merge 1 commit intoangular:masterfrom
Conversation
There was a problem hiding this comment.
Don't be surprise, this is really the normalized form in parser, which already works in template:
<button (click)="onClick(this.$any(this.$event))">Click Me</button>https://stackblitz.com/edit/angular-mgjryy?file=src%2Fapp%2Fapp.component.html
There was a problem hiding this comment.
Showing this now to recognize component property against lexical identifier.
96dc4a2 to
3670f82
Compare
3670f82 to
5f362d9
Compare
|
This is a feature which we very much would like to have. The current PR only solves the syntax for the ViewEngine but not for Ivy. It also does not account for corner cases of containing closure over other variables. So even thought we would very much like this it would take quite a lot of work to get it over the finish line. We will have to implement this with those constraints in mind. |
|
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. |
closes #14129
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: #14129
Suggested by @mhevery in #12969 (comment).
What is the new behavior?
Arrow functions are now supported in template expression, like:
Restrictions from JavaScript syntax:
Does this PR introduce a breaking change?
Other information