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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using {{
and }}
in strings in templates breaks the compiler
#40133
Comments
I believe this was fixed in #39826 which will be part of this week's release :-) |
@JoostK Wow, good timing!! 馃槀 This issue can probably be closed then. |
Could you test with the snapshot builds? "@angular/compiler": "https://github.com/angular/compiler-builds"
"@angular/compiler-cli": "https://github.com/angular/compiler-cli-builds" |
@JoostK Yep that seems to work fine. Although of course my IDE (WebStorm) is still complaining about it. EDIT: Looks like VS Code has similar problems: |
Great to hear it's indeed been resolved. I am not sure about the LS (Language Service) integration; I suspect that WebStorm has its own parsing infrastructure, and VS Code is somewhat unexpected to m but maybe it uses a different version altogether (although I don't think so). There is currently work underway to more tightly integrate the LS with the compiler itself, but I couldn't tell if that would make a difference here. |
Closing this as resolved. |
Sweet! Thanks for your help on this guys! 馃憤 |
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. |
馃悶 bug report
Affected Package
I believe this is caused by incorrect lexer grammars in
@angular/compiler
.Is this a regression?
Not that I'm aware of.
Description
Using
{{ ... }}
inside a string inside a template binding throws compile errors, complaining that it cannot parse the input.For example:
This shouldn't be the case. Strings should be by-definition any characters, and shouldn't stop the app from compiling correctly.
In our use-case, we have a custom i18n solution that uses that syntax for variable replacement within localized strings, and without this fixed, we have to define those strings as class properties in the component's class file instead.
馃敩 Minimal Reproduction
https://stackblitz.com/edit/angular-string-brace-bug?file=src/app/app.component.html
馃敟 Exception or Error
馃實 Your Environment
Angular Version:
Anything else relevant?
I don't think so.
The text was updated successfully, but these errors were encountered: