Skip to content

Instantly share code, notes, and snippets.

@peterbsmyth
Created March 25, 2018 00:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save peterbsmyth/24aa481fe424026079ecd3f061511fb3 to your computer and use it in GitHub Desktop.
Save peterbsmyth/24aa481fe424026079ecd3f061511fb3 to your computer and use it in GitHub Desktop.
api.service.ts for https://blog.upstate.agency
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