Angular 在迭代表8中显示复选框的值 我无法迭代我的表 我无法获取复选框值,只能获取真值和假值 我的复选框

Angular 在迭代表8中显示复选框的值 我无法迭代我的表 我无法获取复选框值,只能获取真值和假值 我的复选框,angular,Angular,内模板- <label class="checkbox-inline" *ngFor="let day of days"> <input type="checkbox" formControlName="{{ day.name }}" name="{{ day.name }}"/> {{ day.value }} </label> 模板: <table class="table

内模板-

  <label class="checkbox-inline" *ngFor="let day of days">
      <input
       type="checkbox"
       formControlName="{{ day.name }}"
       name="{{ day.name }}"/>
       {{ day.value }}
  </label>
模板:

<table class="table table-bordered">
  <thead>
    <tr>

     <th scope="col">days</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <!-- selected day -->
   <td></td> 
    </tr>
  </tbody>
</table>

  • 您忘记了
    属性:

  • 它可以工作,但我只得到true-false的值,我试图显示选中的复选框值,sun,tue,mon
    <table class="table table-bordered">
      <thead>
        <tr>
    
         <th scope="col">days</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <!-- selected day -->
       <td></td> 
        </tr>
      </tbody>
    </table>
    
     <input type="checkbox"
                  formControlName="{{ day.name }}"
                  value="{{day.value}}"
                  name="{{ day.name }}" />{{ day.value }}
    
    <tbody>
        <tr *ngFor="let employee of forTableArray.employee">
          <td>{{employee.firstName}}</td>
          <td>{{employee.lastName}}</td>
          <td>
            <span *ngFor="let skill_exp of employee.skills">
              {{skill_exp.skill}} {{skill_exp.exp}}
            </span>
          </td>
          ...
        </tr>
      </tbody>