compiler: Parser interpolation assertion failure after the introduction of new control flow @ symbol syntax #55772
Labels
area: compiler
Issues related to `ngc`, Angular's template compiler
core: control flow
Issues related to the built-in control flow (@if, @for, @switch)
Milestone
Which @angular/* package(s) are the source of the bug?
compiler
Is this a regression?
Yes
Description
Prior to the introduction of the new control flow, the compiler was successfully handling the custom interpolation marker set to the @ sign in the component interpolation config such as:
Link to a working example V16
now after the introduction of the new control flow, the example above throws
1. [ERROR] NG5002: Incomplete block "p". If you meant to write the @ character, you should use the @ HTML entity instead. [plugin angular-compiler]
IMHO
1 - This seems to be a regression
2- The error failure should not be about the incomplete block which is being thrown right here:
Link to a broken example V17
But rather about unusable interpolation symbol..
As the new control flow is reserving @ for its usage, I would suggest adding it to the UNUSABLE_INTERPOLATION_REGEXPS in the compiler assertion file as follows:
With that we fail properly as follows:
If there is a plan to allow this interpolation case with the new control flow, that might require a more subtle refactor.
I have a PR ready to add the new control flow marker to the unusable/banned interpolation const in the complier/assertions so we provide proper feedback
As of now, if this regression is valid, any existing app that uses the reserved control flow @ sign as a custom interpolation, it will fail upon upgrade to control flow usage.
Looking forward to the team's feedback on this
Please provide a link to a minimal reproduction of the bug
No response
Please provide the exception or error you saw
No response
Please provide the environment you discovered this bug in (run
ng version
)No response
Anything else?
No response
The text was updated successfully, but these errors were encountered: