Last active
May 29, 2018 10:36
-
-
Save langan/abdba3339422c41a624cee047acf02bd to your computer and use it in GitHub Desktop.
This file contains 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'; | |
import { Observable } from 'rxjs'; | |
@Injectable({ | |
providedIn: 'root' | |
}) | |
export class WordpressService { | |
constructor(private http: HttpClient) { } | |
getPosts(): Observable<any[]> { | |
return this.http.get<any[]>('http://www.oxygenna.com/wp-json/wp/v2/posts?_embed', { | |
params: { | |
per_page: '6' | |
} | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment