HTML element attribute interpolation is not handle correctly
See original GitHub issueWhich @angular/* package(s) are the source of the bug?
Don’t known / other
Is this a regression?
No
Description
HTML element attribute interpolation is not handle correctly.
For the below code, attribute interpolation doesn’t work.
<img aria-label="image of {{image.desc}}" [src]="image.src">
While for this code, the attribute interpolation with attr.
prefix does work.
<img attr.aria-label="image of {{image.desc}}" [src]="image.src">
The usage of attr.
prefix is not documented. Please either update the documentation or change the attribute interpolation handler.
Thanks.
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
Issue Analytics
- State:
- Created a year ago
- Reactions:3
- Comments:11 (10 by maintainers)
Top Results From Across the Web
Property binding vs attribute interpolation - angular
When property corresponding to the attribute doesn't exist for example colspan doesn't have corresponding dom property so attribute binding is required.
Read more >Understanding Angular property binding and interpolation
Property binding and interpolation are the data binding types in Angular, used for moving data from the component to the template. Data binding ......
Read more >Displaying values with interpolation - Angular
Displaying values with interpolationlink Interpolation refers to embedding expressions into marked up text. By default, interpolation uses the double curly ...
Read more >Attribute selectors - CSS: Cascading Style Sheets | MDN
The CSS attribute selector matches elements based on the presence or value of a given attribute.
Read more >HTML attribute - Wikipedia
HTML attributes are special words used inside the opening tag to control the element's ... for that element type to function correctly; (2)...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@ilyassFouih go for it!
Update: I was toying with the idea of a diagnostic that would detect bindings / interpolations for
aria-
prefixed names (and suggest addingattr.
prefix. In practice, though, there are directives that will use thearia-
prefix for their input names.I’m afraid that the best we can do is to review the documentation here and revisit this issue in the scope of the larger authoring format review.