我在程序中过滤数据时遇到了一些问题。
以下是我的JSON示例:
{
"expression": "to the day",
"meaning": "",
"example": "it's been four years to the day.",
"pronunciation": "",
"notes": "",
"meta": {
"book": [""],
"author": [""],
"tags": ["music"]}
},
foll是我的过滤逻辑的一部分:
<md-input-container>
<label>Enter Search Term</label>
<input type="text" ng-model="classifiedsFilter">
</md-input-container>
<md-input-container>
<label>Tags</label>
<md-select ng-model="tag">
<md-option ng-repeat="tag in tags | orderBy: 'toString()'" value="{{ tag }}"> <!-- tags here refers to a newly defined array that stores only one instance of all the tags against the 'tags' property on each object/word -->
{{ tag }}
</md-option>
</md-select>
</md-input-container>
foll是我在md-card上的过滤器:
<md-card ng-repeat="classified in classifieds | filter: classifiedsFilter | filter: tag:true | filter: expression | filter: book:true | filter: author:true | orderBy: order" flex-xs="100" flex-sm="40" flex-gt-sm="30" class="classified">
我面临的问题如下:
如果我要从Tags下拉列表中选择特定标签。结果按预期收窄;但是,当我单击“清除”按钮时,不会显示任何结果。我必须刷新页面才能再次显示所有结果
你能帮我理解我在哪里出错吗?
由于