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.

Allow custom attributes with dot (some-name.some-suffix) interpolation

See original GitHub issue

🐞 bug report

Affected Package

Any version i guess

Is this a regression?

No

Description

Allow to handle complicated custom attributes by html parser

🔬 Minimal Reproduction

https://stackblitz.com/edit/angular-playground-zhx28b

Take a look on hello-framework.component.html

<button data-ts.label="abc">action 1</button>
<button data-ts.label="{{name}}">action 2</button>
<button [attr.data-ts.label]="name">action 3</button>

EXPECTED all three button should have data-ts.label="some-title"

🔥 Exception or Error

For case with <button data-ts.label="{{name}}">action 2</button> it throws


Error in /turbo_modules/@angular/compiler@7.2.4/bundles/compiler.umd.js (2496:21)
Template parse errors:
Can't bind to 'ts.label' since it isn't a known property of 'button'. ("

<button data-ts.label="some-title">action 1</button>
<button [ERROR ->]data-ts.label="{{title}}">action 2</button>
<button [attr.data-ts.label]="title">action 3</button>"): ng:///HelloFrameworkModule/HelloFrameworkComponent.html@5:8

Third example with <button [attr.data-ts.label]="name">action 3</button> cuts .label suffix

image

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
n-srgcommented, Jun 14, 2022

Everything is fine now, thank you for closing this, @jessicajaniuk !

0reactions
angular-automatic-lock-bot[bot]commented, Jul 15, 2022

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Add custom attribute to a dot SVG edge using jQuery
So far, I have only found a way to add a custom identifier. Is there any way to add also a custom class?...
Read more >
Custom Attributes - YouTube
Something missing from .NET? You can add it yourself with custom attributes.Source code available at: ...
Read more >
How You Can Use HTML5 Custom Data Attributes and Why
Gajendar Singh walks you through HTML5 custom data attributes, why they're useful, how to style them with CSS and manipulate them with ...
Read more >
Built-in and Custom Data Attributes - Beginner JavaScript
All attributes on an element are done via getters and setters. You can use the dot notation to access them. You may have...
Read more >
Collect custom attributes - New Relic Documentation
Using reserved terms can cause issues. To enable and use custom attributes for APM, follow the procedure for your APM agent: C SDK....
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