I don't understand how ng-if work in a list

115 Views Asked by At

I don't understand how ng-if works:

I would like that a button in a list is visible only if a condition is verified. In the example below, a button should only be visible if a list element has title == 'Title2'

<ul>
    <li ng-repeat="o in options">{{o.title}}
        <button ng-if="o.title=='Title2'">BTN</button>
    </li>
</ul>

But as you can see from the code here all array elements show up

0

There are 0 best solutions below