admin管理员组

文章数量:1303411

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

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"}]}
Share Improve this question edited Apr 5, 2020 at 3:59 Dan 63.1k18 gold badges110 silver badges119 bronze badges asked May 30, 2013 at 3:06 user1159790user1159790 3052 gold badges3 silver badges10 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 7

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.

本文标签: javascriptUnknown provider uniqueFilterProvider using unique filter in AngularjsStack Overflow