【发布时间】:2018-04-05 08:11:12
【问题描述】:
我在这样的 angular 5 框架中使用 angular material select。
<mat-form-field>
<mat-select (change)="viewdropdownchange($event.target.value)" [(ngModel)]='this.current_view_id'>
<mat-option *ngFor="let viewname of secondMenu;" value={{viewname.id}}>
<span>{{viewname.value}}</span>
<mat-chip-list style="float: right;margin-top: 7px">
<mat-chip style="background-color: #3f51b5;color: #fff;">Edit </mat-chip>
<mat-chip style=" background-color: #ff4081;color: #fff;">Clone</mat-chip>
<mat-chip style="background-color: #f44336;color: #fff;">Delete</mat-chip>
</mat-chip-list>
</mat-option>
</mat-select>
</mat-form-field>
但所选选项的标签包含芯片标题,如编辑、克隆删除等。我想在选择框中显示为选定选项时删除它们。
如何删除剩余的编辑、删除、克隆?
【问题讨论】:
-
我认为这里不会有干净的解决方案。您可以尝试在 dom 中查询选择适当的元素并将另一个文本分配给标签元素
标签: css angular material-design angular-material