Created
October 8, 2017 19:09
-
-
Save NMZivkovic/510f8d8eed4b835f4d2c2eb807526b7b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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