I have a component where the data is resolved by the router, like:
this.route.data.subscribe((data => { .....
Now we've added an http post transaction to this component that changes the state of the data that we resolved.
Is there a handy way to re-resolve the route data?
Adding some more code... some things were changed to protected the IP, so forgive any syntax errors.
In a sub-component, subscribing to the post:
this.myDataService.postUpdate(id, this.noteText).subscribe(
data => {
this.userMessageService.send('success', 'Update Complete', 'The update has been updated.');
},
error => this.userMessageService.send('error', 'Update Error', 'The update failed: ' + <any>error)
);
Then in "myDataService":
postUpdate(id: number, notes: string) {
return this.http
.post(this.url,
{ "Id": id, "Notes": notes }, options)
.map((res) => {
return {};
})
.catch((e) => {
return Observable.throw(e.message || e);
});
}