【发布时间】:2019-03-09 18:38:28
【问题描述】:
我有以下代码:
HTML:
<select>
<option *ngFor="let item of items">{{item}}</option>
</select>
一些 Angular 服务:
items = [
{name: "item1", type: "type1"},
{name: "item2", type: "type2"},
{name: "item3", type: "type2"}
];
还有一些过滤函数,按类型过滤数组并返回新数组。
我没有遇到按如下按钮过滤的问题:
<button type="button" (click)="Filter('type2')"></button>
但我不能使用下拉菜单。
UPD:解释不正确。 Here 现场演示。需要使用brandName在选择标签处过滤带有(更改)事件的数组
【问题讨论】:
-
您能具体说明一下这个问题吗?
标签: javascript angular filtering