首页 > 解决方案 > 我需要在材料下拉列表中打勾

问题描述

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":"`&#10004;`"},
    {"ID":"0","Value":"X"},
    {"ID":"L","Value":"L"},
    {"ID":"UL","Value":"UL"},
    {"ID":"PL","Value":"PL"},
    {"ID":"BT","Value":"BT"},
    {"ID":"H","Value":"H"}
 ];

标签: angularangular-material

解决方案


您可以像这样添加刻度线,

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"}
 ];

推荐阅读