I am using a bootstrap table and trying to change the background color of the row that I click. Trying to do this with ngClass based on active on inactive states is not helping.
Here's the code where I try to bind inside template :
<tr *ngFor="#data of mySoCalledData" (click)="myClickedRowData()" [ngClass]="{'active': isActive}"> <td></td>
.
.
</tr>
Here I pass the value of isActive inside class:
myClickedRowData(){ isActive = true;
}
And the CSS is:
.active { background-color: red;
}
How do I make the background color change so it looks selected?