Mandar Shinde

Mandar Shinde

  • NA
  • 423
  • 110.4k

On click another row of a table is getting highlighted

Apr 6 2019 12:29 AM
I want to highlight the row on which i am clicking.
 
I am highlight last record/row of table with his id in angular 6. what i am doing is-
I am retriving some records from a database and showing in dynamic table.This is code of highlighting
 
last record
 
<tr *ngFor="let item of items1 ; let i = index; let last = last"
(show) ="Highlighted(item,item.ID)" (click)="GetData(item,item.ID)"
[ngClass]="{highlight : last}" id="cursor">
 
But when i click on other record that record/row and last row both are highlited.I want to highlight that row which i am clicking on. Any help will be appericiated.

Answers (2)