question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

HTML element attribute interpolation is not handle correctly

See original GitHub issue

Which @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:open
  • Created a year ago
  • Reactions:3
  • Comments:11 (10 by maintainers)

github_iconTop GitHub Comments

4reactions
pkozlowski-opensourcecommented, Sep 21, 2022

@ilyassFouih go for it!

1reaction
pkozlowski-opensourcecommented, Dec 5, 2022

Update: I was toying with the idea of a diagnostic that would detect bindings / interpolations for aria- prefixed names (and suggest adding attr. prefix. In practice, though, there are directives that will use the aria- 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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found