Skip to content

Instantly share code, notes, and snippets.

@AlexanderKozhevin
Created June 23, 2017 17:04
Show Gist options
  • Save AlexanderKozhevin/f4527564661d35bbac392e7a9e1f747e to your computer and use it in GitHub Desktop.
Save AlexanderKozhevin/f4527564661d35bbac392e7a9e1f747e to your computer and use it in GitHub Desktop.
import { Injectable } from '@angular/core';
import { Http, Response } from '@angular/http';
import 'rxjs/add/operator/map';
@Injectable()
export class UserService {
constructor (
private http: Http
) {}
getUser() {
return this.http.get(`https://conduit.productionready.io/api/profiles/eric`)
.map((res:Response) => res.json());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment