简体   繁体   中英

Unknown provider: uniqueFilterProvider using unique filter in Angular.js

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"}]}

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM