Created
March 25, 2018 00:58
-
-
Save peterbsmyth/24aa481fe424026079ecd3f061511fb3 to your computer and use it in GitHub Desktop.
api.service.ts for https://blog.upstate.agency
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
import { Injectable } from '@angular/core'; | |
import { HttpClient } from '@angular/common/http'; | |
@Injectable() | |
export class ApiService { | |
constructor( | |
private http: HttpClient | |
) { } | |
getPosts() { | |
return this.http.get('https://jsonplaceholder.typicode.com/posts/'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment