我有形式值与'我'甚至必须发送存储在本地主机的ID。我该怎么做.........任何人都请建议帮助....如何将值推入数组
onSubmit(form){
console.log(form);
var str = localStorage.getItem('social');
var loc = JSON.parse(str);
var profile_id = loc.profile_id;
var headers = new Headers();
headers.append('Content-Type','application/x-www-form-urlencoded')
this.http.post('http://localhost/angular/index.php/profile/addaddress', JSON.stringify(form),{headers:headers})
.subscribe(
response => {
if(response.json().error_code ==0){
alert('added successfully');
}
else{
alert('fail');
}
})
}
}
那你想干什么?它对我不明确。 – micronyks