我似乎找不到在下拉列表中过滤选项的方法。
<div>
<select>
<option ng-repeat="draw in draws| filter:{draw.perform == true && automatic == false}">
</option>
</select>
</div>
数据看起来像:
{
automatic: true,
date: 1417388400000,
drawQuantity: 0,
number: 1,
offer: {
image: "/"test,
number: 1
},
perform: true
}
我从 firebase 获取数据,这就是为什么我需要在前端进行过滤。如果有人想知道的话。
最佳答案
您的语法不正确。试试这个:
ng-repeat="draw in draws| filter:{perform: true, automatic: false}"
如果您需要按属性值进行过滤,则应使用 object notation .
关于javascript - angularjs过滤器按对象属性的下拉选项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26488636/