My code:
component class:
this.locknumbers = true;
onclick(){
this.locknumbers = false;
}
.disabledRows {
opacity: 0.5;
filter: alpha(opacity=50);
cursor: default;
}
[ngClass]= "{'disableRows':locknumber}".
<a (click)="onClick()"> Enable </a>
Initially it is disabled but when I click on enabled button, the contents are still disabled but in console I can see the value of this. lock numbers changing to false; even though the style class is applied on click.
locknumberinstead oflocknumbers.