I try to reach the MeanStack project, when I try to click the refresh button, I get this error: Error: the requested path contains an undefined segment at index 1
There is an update service
updateLocation(id, data) { return new Promise((resolve, reject) => { this.http.put('https://exemple.herokuapp.com/api/A/'+id, data) .map(res => res.json()) .subscribe(res => { resolve(res); }, (err) => { reject(err); }); }); }
html
<form (submit)="onEditSubmit()">
And the .ts component
onEditSubmit() { this.locationService.updateLocation(this.id,this.location).then((result) => { let id = result['_id']; this.router.navigate(['locations/', id]); }, (err) => { console.log(err); }); }
angular mean-stack
Taieb
source share