【发布时间】:2018-09-18 15:29:40
【问题描述】:
addProduct(productForm:NgForm){
this.productService.addProduct(productForm.value).subscribe((res:any)=>
res= this.addProduct(res)
);
}
.服务:
addProduct(productForm:NgForm) {
return this.httpObj.post<products>(`${this.uri}/products`,productForm,{
headers: new HttpHeaders({
'Content-Type': 'application/json'
})
});
当我输入表单数据并提交时,最后输入的数据被覆盖并输入了新数据。新数据后,插入了多个空行。可能是什么问题?
【问题讨论】:
-
嗯,可能是后端问题?进入网络选项卡,并截取您发送到服务器的有效负载。让我们看看它
-
我已添加请检查
标签: angular http-post httpclient