Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

252
Views
Template parse errors: Can't bind to 'item-value' since it isn't a known property of 'td'

I am trying to do following:

<tr id="row" *ngFor="let data of dataList">
   <td class="search-result" data-item-value="{{data.value}}">
      {{data.text}}
   </td>
</tr>

Here dataList is an array of object with prop value and text.

I am getting following error:

zone.js:522 Unhandled Promise rejection: Template parse errors: Can't bind to 'item-value' since it isn't a known property of 'td'. ("" *ngFor="let data of dataList"> ]data-item-value="{{data.value}}">{{data.text}} "): MultiListBoxComponent@24:66 ; Zone: ; Task: Promise.then ; Value: SyntaxError {__zone_symbol__error: Error: Template parse errors: Can't bind to 'item-value' since it isn't a known property of 'td'. ("……} Error: Template parse errors: Can't bind to 'item-value' since it isn't a known property of 'td'. ("" *ngFor="let data of dataList"> ]data-item-value="{{data.value}}">{{data.text}} "): MultiListBoxComponent@24:66

Is value binding to custom attributes not allowed in angular 2?

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

You have to use

[attr.data-item-value]="data.value"

instead of

data-item-value="{{data.value}}"
over 4 years ago · Santiago Trujillo Report

0

Check: https://stackoverflow.com/a/38792409/5049472

You could use DomSanitizationService with a function generating td.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!