I bring news from a wordpress, but I want to be able to update the news every so often, and it would be calling the builder who brings the news ... I show the code.
import { Injectable } from '@angular/core';
export const WORDPRESS_URL = 'http://despertadorlavalle.com.ar/';
export const WORDPRESS_REST_API_URL = WORDPRESS_URL + 'wp-json/wp/v2/posts?categories=817';
import 'rxjs/add/operator/map';
import 'rxjs/add/observable/forkJoin';
import { Http } from '@angular/http';
@Injectable()
export class WordpressProvider {
constructor(public http: Http) {
}
getRecentPosts(page:number = 1){
return this.http.get(
WORDPRESS_REST_API_URL)
.map(res => res.json());
}
}