0

I have a select with ng-repeat option, How to show all the options except for the options which contains 'TM'?

<select ng-model="mainCtrl.header.selectedItemId" class="form-control">
    <option ng-repeat="option in mainCtrl.items | filter:'TM'" ng-value="option.id">{{option.name}}</option>
</select>   
Len
  • 534
  • 1
  • 15
  • 31

1 Answers1

2

As described in SO Answer here you can use negation in your filter

<select ng-model="mainCtrl.header.selectedItemId" class="form-control">
        <option ng-repeat="option in mainCtrl.items | filter:'!TM'" ng-value="option.id">{{option.name}}</option>
    </select>
Shoaib
  • 822
  • 1
  • 15
  • 27