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