【发布时间】:2018-05-19 10:19:32
【问题描述】:
我正在开发 Spring Boot 的后端应用程序和 Angular 5 的前端应用程序。 我有一个下拉列表。 这是列表的代码。
<select #selectElem (change)="onSelectCat($event.target.value)" >
<option *ngFor="let categorie of categories" [value]="fournisseur.categorieid" id="categorieid" name="categorieid">
{{categorie.libelle}}
</option>
</select>
我想从列表中检索选定的值,并将其与表单发送的提供者对象一起添加,方法是单击按钮添加调用此函数的人:add.component.ts
newUser(fournisseur){
this.fournService.createFourn(this.fournisseur).subscribe((fournisseur)=>{
console.log(fournisseur);
// this.router.navigate(['/*/listsuppliers'])
},(error)=>{
console.log(error);
});
}
任何想法,提前谢谢你
【问题讨论】:
标签: angular spring-boot select data-binding