Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
@Injectable()
export class UserService {
constructor(private http: Http) {
}
updateUser(user:User): Observable<any>{
return this.http.post("http://localhost:3000/updateUser", user)
.map((res:any) => {
return res.json();
})
.catch((error:any) => {
return Observable.throw(error.json ? error.json().error : error || 'Server error')
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment