0
我有一個墊選擇下拉列表與多個啓用和我使用NgModel來存儲用戶選擇的值。Angular2/4墊選多個ngModel
問題是,當我瀏覽到另一個頁面,回來了用戶選擇的值不是在墊子select..I知道ngModel具有這些值...我失去了一些東西......
HTML
<mat-form-field>
<mat-select placeholder="Customers" name="customerDetails" ngDefaultControl
formControlName="customerDetails" [(ngModel)]="custonerDetails"
[formControl]="customerDetailsCtrl" multiple
(ngModelChange)="onCustomerValueChanges(customer)" >
<mat-option *ngFor="let customer of customerDetailsResult"
[value]="customer">{{customer.CustomerNo}}-
{{customer.CustomerDescription}}
</mat-option>
</mat-select>
</mat-form-field>
任何想法?
錯字= custonerDetails:
試試這個? –
@MicheleSapignoli在此處發帖時錯字...在代碼中是正確的 –