-2

I try to build a User bar like in Facebook "New Friend Requests" ore "New Pms"

This is now my HTML Template Code:

<li class="icon-element pms">
    <div class="icon" ng-include="iconPm"></div>
    <span class="counter">{{account.newPms}}</span>
</li>

In the span is {{account.newPms}} this can be 0. If it is 0, then i want to set a class in the li namend "is-zero"

I found some in other topics like:

<li ng-if="account.newPms == '0'></li>

but how i can set the class in the li if it is 0?

best regards!

Sven Budak
  • 123
  • 2
  • 11
  • 1
    Note that because your class has a `-` in it, you need to put the name in quotes, which they didn't have to do in the linked question because the name was `test` and so they didn't need them: `
  • ` See also the `has-error` example [in the documentation](https://docs.angularjs.org/api/ng/directive/ngClass).
  • – T.J. Crowder Jun 23 '16 at 15:25
  • Thanks alot for this short and exact answere! This will helps me alot. – Sven Budak Jun 23 '16 at 15:29