Unknown provider: uniqueFilterProvider using unique filter in Angular.js

user1159790 picture user1159790 · May 30, 2013 · Viewed 10.7k times · Source

I am new to AngularJS. I am trying to implement filtering to build a unique list of options for the select box. My code is as follows

<select name="show-filter" id="show-filter" ng-model="card" ng-options="v for v in currentOptions.cards  | unique:'cardno'">
<option value="">All</option>
</select>   

I am getting the following error

Error: Unknown provider: uniqueFilterProvider <- uniqueFilter

sample JSON (wrapped into $scope.currentOptions)

"cards ":[{"cardno":"123223333"},{"cardno":"123223333"},{"cardno":"123223333"}]}

Answer

Dan picture Dan · May 30, 2013

AngularJS does not have a built-in unique filter. You may be looking for the third-party add-on library called AngularUI that does have such a filter.