想要将新值发送到对象,则选择掉值

时间:2019-05-27 06:15:16

标签: angular

我希望每当我单击一个角度下拉菜单时,该值都应传入对象,该值将被发送到api,即在此处每次均默认为“ 28152”,但在drodpwn值为时应更改为“ 0002”选定而不是硬编码的值,希望在单击drpdown时动态更改

 //creating object
postobj = new Post('28152','0002');

//passing value to method which will send the value to service
save(): void {
  this._dataService.PostValues(this.postobj);
  console.log("posted", this.postobj);
}

//service which is sending value to api
PostValues(opost:Post):Observable<Post>{
  console.log("sending post  :- "+ opost.mcn + " : "+ opost.Store_no);
  var requestBody = JSON.stringify(opost);
  return this._http.post<Post>("http://localhost:8080/getTotalSubset",requestBody);

}

0 个答案:

没有答案