How can I pass a parameter to a css class in angular ?
.div-disabled[status="true"]
{
pointer-events: none;
opacity: 0.5;
background: #CCC;
}
In my .ts file , I have disableDiv = true;
Tried the following, doesnot seem to work.
<div status="{{disableDiv}}" class="div-disabled"></div>
Try this
css file
.div-disabled[status=true] {
pointer-events: none;
opacity: 0.5;
background: #CCC;
}
html file
<div [attr.status]="disableDiv" class="div-disabled"></div>