Angular interpolation in HTML attribute "name"
<input type="radio" name="{{foo}}" formControlName="{{foo}}">
IntelliJ understands, that {{foo}} is an interpolation in the formControlName-attribute.
But in the name attribute it does not. It thinks, that {{foo}} is an array and that I am missing a : Like in {foo : bar}.
The code compiles just fine, is this an IntelliJ-Bug?

Please sign in to leave a comment.
can't reproduce with similar syntax. Screenshot shows that there is some language injected in this attribute. Please check custom injections in Settings | Editor | Language Injections - all injections with
IDEandProjectscope are custom ones - do you have any? Also, please put cursor within name attribute value and hit Alt+Enter - what menu can you see?I opened Settings | Editor | Language Injections. Everything is "build-in", no IDE or Project Scope. No Cusoum ones.
Screenshot of the Alt+Enter:
As you can see in the screenshot I used a workaround with property binding since
name="{{foo}}"<=>[name]="foo"That worked, but the interpolation in attributes should work as well...
can you share a sample project/files the issue can be reproduced with plus your idea.log (Help > Show log in ...)?
Very Strange. I just copied the code in a new project to create a sample, there it works just fine.
The log is here:
https://filebin.net/axz6c4pg09ehmc7r
it works fine for me as well... that's why I've asked for a project.
BTW, does the issue persist after caches invalidation (File > Invalidate caches, Invalidate and restart)?
Yes, the issue persists.
I just copied the whole .html and .ts File to a new project, it just works fine there. It recognised angular and everything. So something must be broken inside my settings for that project, it is not an IntelliJ-Bug.
But since the property binding workaround works just fine for me lets leave it there. Thank you for your help :)
/closed