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

150
Visualizações
get data from html table in angular

i am trying to get data from html table in angular.

component.html:

<div class="col-lg-6">
        <table style="width: 90%;">
          <tr>
            <th
              style="
                border-left-color: white;
                border-top-color: white;
              "
            ></th>
            <th class="t1">Name</th>
            <th class="t1">Issue Date</th>
            <th class="t1">Expiry Date</th>
            <th class="t1">Add License</th>
          </tr>
          <tr *ngFor="let licence of licencesImages">
            <!-- Licence Image -->
    
            <td>
              <img [src]="licence.path" style="max-width: 30px" />
            </td>
            <!-- Licence Name -->
            <td>{{ getLicenceVehicleType(licence.name) }}</td>
            <!-- Licence Issue Date -->
            <td>
              {{ getLicenceDate(licence.issued_date) }}
            </td>
            <!-- Licence Due Date -->
            <td>{{ getLicenceDate(licence.due_date) }}</td>
            <!-- Add Licence -->
            <td>
              <i
                class="fa fa-plus-circle cursor-pointer"
                aria-hidden="true"
                style="color: green"
                (click)="onAddLicense(output)"
              ></i>
            </td>
          </tr>
        </table>
      </div>

in component.ts:

  onAddLicense(output) {
    console.log(output)
  }

my case is different from mat-table, in each row i have a button related to this row.

how i can get data from this row on click on button?

i try to replace output by $event.target.valuebut not work.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

@op instead of doing like :

 <i
   class="fa fa-plus-circle cursor-pointer"
   aria-hidden="true"
   style="color: green"
   (click)="onAddLicense(output)"
  ></i>

do it like :

<i
   class="fa fa-plus-circle cursor-pointer"
   aria-hidden="true"
   style="color: green"
   (click)="onAddLicense(licence)"
  ></i>
about 4 years ago · Juan Pablo Isaza 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