Is there a way for a div to have a css-class based on a specific value of the variable cfgSelected
, in this case '1' (as a string)?
<div [ngClass]="(cfgSelected ==='1')?'isActive':'isNormal'"
(click)="selectThisOne('1')">
bla ...
</div>
In the ts-file:
selectThisOne(id: any) {
this.cfgSelected = id;
}
This code works in --dev but throws an error when trying to build --prod:
ERROR in src\app\configurator\configurator.component.html(80,50): : Operator '===' cannot be applied to types 'number' and 'string'.
Can someone help me figure out what is causing this issue?