【发布时间】:2016-11-23 09:01:18
【问题描述】:
我正在尝试使用unique下面的过滤器
<ng-repeat="feature in allfeatures | unique:'featureName'" value="{{feature.featureName}}">{{feature.featureName}}>
但它给了我这样的错误,
错误:[$injector:unpr] http://errors.angularjs.org/1.3.15/$injector/unpr?p0=uniqueFilterProvider%20%3C-%20uniqueFilter
<select id="selectFeature" ng-model="features"
ng-required="true"
multiple class="form-control" onchange="angular.element(this).scope().populateAllFeaturesTaxonomy(this)" style="width: 200px;">
<option ng-repeat="feature in allfeatures | unique:'featureName'" value="{{feature.featureName}}">{{feature.featureName}}</option>
</select>
【问题讨论】:
-
您的 html 无效。你能贴一些真实的代码吗?
-
-
您可以编辑您的帖子。其次,您还可以使用 ng-options 指令。 docs.angularjs.org/api/ng/directive/ngOptions
-
这个独特的过滤器来自哪里?我不认为这是标准的 angularjs?
-
stackoverflow.com/questions/24832192/… ..这是我关注的一些链接..但它仍然给我带来了唯一值的 ng-options 问题