angular - 我需要在材料下拉列表中打勾
问题描述
html
<th mat-header-cell *matHeaderCellDef> M </th>
<td mat-cell *matCellDef="let element">
<mat-select [(ngModel)]="element.Monday">
<mat-option [value]="active.ID" *ngFor="let active of activeList">
{{ active.Value }}
</mat-option>
</mat-select>
</td>
</ng-container>
ts文件
activeList = [
{"ID":"1","Value":"`✔`"},
{"ID":"0","Value":"X"},
{"ID":"L","Value":"L"},
{"ID":"UL","Value":"UL"},
{"ID":"PL","Value":"PL"},
{"ID":"BT","Value":"BT"},
{"ID":"H","Value":"H"}
];
解决方案
您可以像这样添加刻度线,
activeList = [
{"ID":"1","Value":"✓"},
{"ID":"0","Value":"X"},
{"ID":"L","Value":"L"},
{"ID":"UL","Value":"UL"},
{"ID":"PL","Value":"PL"},
{"ID":"BT","Value":"BT"},
{"ID":"H","Value":"H"}
];
推荐阅读
- julia - 如何将 Julia 中的任何函数重置为其原始状态?
- php - 将产品添加到购物车时出现 HTTP 错误 500(使用会话的 php)
- tensorflow - TensorFlow 神经网络不起作用,类型不兼容
- scipy - python scipy中稀疏矩阵和向量的转置之间的点积
- kubernetes - 为什么即使创建了部署,我也会收到 OCI 运行时错误
- apache-kafka - 从 Kafka 的主题中删除一条消息
- python - 使用 Python 在 Ursina 中使用 Perlin 噪声
- c - 如何使用 makefile 编译静态库
- coordinates - 3d 坐标上的 DBSCAN 找不到集群
- tls1.2 - 确保 TLS 1.2 协议以供参考