Q:

If / else on HTML markup with AngularJS

<span ng-if="ItemIndex.ItemCount>0"><a href="#" ng-click="deleteItem(ItemIndex)"
    class="underlined-text-button"><i
    class="glyphicon glyphicon-remove"></i> Remove items</a>
</span>

If I have more than 0 item, text getting 'Remove items', right. But I want, if I have one item, text change to 'Remove item'
So,
item == 1 == remove item
item > 1 == remove items
How can I setup this?

A:

use like this,
<span ng-if="ItemIndex.ItemCount>0">
    <a href="#" ng-click="deleteItem(ItemIndex)"
    class="underlined-text-button"><i
    class="glyphicon glyphicon-remove"></i> 

    {{ (ItemIndex.ItemCount == 1) ? 'Remove item' : 'Remove items' }}

    </a>
</span>

if (ItemIndex.ItemCount == 1) is true then prints Remove item, else prints Remove items.
OR you can use ng-show, ng-hide or ng-if,
 <span ng-if="ItemIndex.ItemCount>0">
    <a href="#" ng-click="deleteItem(ItemIndex)"
    class="underlined-text-button"><i
    class="glyphicon glyphicon-remove"></i> 

    <span ng-show="ItemIndex.ItemCount == 1"> Remove item </span>
    <span ng-show="ItemIndex.ItemCount > 1"> Remove items </span>

    </a>
</span>

