ngFor in ngFor in select?

时间:2017-09-25 08:28:35

标签: angular

   <li *ngFor="let billingAccount of customerGeneralInfo?.groupedByTechnology">
       <tr *ngFor="let billingaccount of billingAccount.billingAccounts">
        <td>{{billingaccount?.id}}</td>
       </tr>
  </li>

我想在billingaccount?.id中显示此select。有什么建议吗?

1 个答案:

答案 0 :(得分:2)

假设billingAccounts的类型为BillingAccounts, 试试这是否有效:

<li *ngFor="let billingAccount of customerGeneralInfo?.groupedByTechnology">
       <select [(ngModel)]="billingAccount.BillingAccounts">
        <option *ngFor="#billingaccount of billingAccount" [value]="billingaccount.id">{{billingaccount.id}}</option>
       </select>
  </li>