0
我想有用戶名下拉列表,然後我可以檢查多個用戶,並保存所選擇的用戶在陣列中的ID來循環他們..我用angular-2-dropdown-multiselect,但我可以「T改變它 [https://www.npmjs.com/package/angular-2-multiple-selection]多選下拉角4
<select class="custom-select" [(ngModel)]="username" formControlName="username" multipe >
<option *ngFor="let user of users" [value]="user.user_ID"> {{ user.user_Name }} </option>
</select>
我想使myOptions從API響應等於
我試圖使在溫妮這個響應的值的包工作:
this.dataStorageService.getUsers().subscribe(response => {
this.users= response.json() ;
});
for(let i = 0 ; i < this.users.length; i++){
this.test= this.users[i].user_Name;
this.testId = this.users[i].user_ID;
this.myOptions=[
{ id : this.testId , name: 'this.test'}
]
}
,但它不工作....
您使用的材料? – Sajeetharan
不,我沒有用它 –
爲什麼特指這個packagE? – Sajeetharan