Hi,
ngClass doesn't work when hyphen is used. Consider the following scenario
where I am getting data from backend that has status as one of it's
properties.
<div *ngFor="#data of myData">
<div [ngClass]="'data.status-circle"></div>
</div>
</div>
Consider that data.status returns 'critical' from backend. Now we should be
able to bind the following css with the ngClass. But the use of hyphen
restricts this binding. Although the binding will work by simply using
data.status in the html and only .critical in css, but I want to append
something to it because this ngClass with name critical may be used in many
other places. How do I achieve this ?
In the css file, I have the following :
.critical-circle {
width:15px;
height:15px;
}
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.