javascript 未知提供者:uniqueFilterProvider 在 Angular.js 中使用唯一过滤器
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/16827300/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Unknown provider: uniqueFilterProvider using unique filter in Angular.js
提问by user1159790
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
我是 AngularJS 的新手。我正在尝试实施过滤来为选择框构建一个唯一的选项列表。我的代码如下
<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
错误:未知提供者:uniqueFilterProvider <- uniqueFilter
sample JSON (wrapped into $scope.currentOptions
)
示例 JSON(包装为$scope.currentOptions
)
"cards ":[{"cardno":"123223333"},{"cardno":"123223333"},{"cardno":"123223333"}]}