Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

260
Vistas
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 Respuestas
Responde la pregunta

0

You have to use

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

instead of

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

0

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

You could use DomSanitizationService with a function generating td.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda