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

171
Visualizações
How do I display a button only when a row is selected in Angular

I have added an extra column to a table for a button to export a row from my table. I’m trying to make it so that button is only displayed for the selected row. (When you haven’t selected any rows there is no button to export the row but when you have selected a row there is a button to export the selected row but only on the row you have selected). I’ve been trying to use ngif but am new to angular so haven’t been able to figure out a solution.

** HTML CODE: **

<button type=“button” class=“btn” (click)=export()>Export</button>
over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

Try the below code:

HTML:

<button *ngIf="selected" type=“button” class=“btn” (click)=export()>Export</button>

TS:

Selected:Boolean=false;

selecteddrow(){
//some condition to for selecting the row.
this.selected=true;

}

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