我有'from'中的form值,我什至必须发送存储在localhost中的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');
}
})
}
}
onSubmit(form){
...
var profile_id = loc.profile_id;
form.profile_id=prifile_id;
...
}
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句