Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

253
Visualizações
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 Respostas
Responde à pergunta

0

You have to use

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

instead of

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

0

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

You could use DomSanitizationService with a function generating td.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda