Gitaram Kanawade Gitaram Kanawade - 2 years ago 80
HTML Question

ng-class with dnyamic values and expression

I have following ng-class syntax with profileView.rating is value from API.

<span ng-class="{'badge-rating-{{profileView.rating}}*2':true}"></span>

I have to apply class for this span like badge-rating-1,badge-rating-5.Now If I have profileView.rating value 0.5 then for this span 'badge-rating-0.5*2'
How Can I solve this expression

Answer Source

You can do like this in your ng-class syntax

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download