Skip to content

Instantly share code, notes, and snippets.

@rajesh-h
Last active December 18, 2017 20:42
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 rajesh-h/7a1f54e3d5328b0bc7bbe55e41950374 to your computer and use it in GitHub Desktop.
Save rajesh-h/7a1f54e3d5328b0bc7bbe55e41950374 to your computer and use it in GitHub Desktop.
import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular';
import { wpApiPosts } from 'wp-api-angular';
/**
* Generated class for the CustomHomePage page.
*
* See https://ionicframework.com/docs/components/#navigation for more info on
* Ionic pages and navigation.
*/
@IonicPage()
@Component({
selector: 'page-custom-home',
templateUrl: 'custom-home.html',
})
export class CustomHomePage {
title: string;
posts: any;
constructor(public navCtrl: NavController, public navParams: NavParams, private wpApiPosts : wpApiPosts) {
this.title = 'Cooking Shooking';
//Get Latest posts
posts = this.wpApiPosts.getList()
.map(response => response.json())
.map(data => {})
}
ionViewDidLoad() {
console.log('ionViewDidLoad CustomHomePage');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment