Hey All Guys, hope you all will be fine.
Actually I am working with Ionic and wordpress. I want to display posts categories, and I get this. But the problem is I want to pass the posts according to their categories.
See my .ts file
constructor(public navCtrl: NavController, public navParams: NavParams, public storage: Storage, public modalCtrl: ModalController, private events: Events, private ngZone: NgZone, private api: ApiProvider) {
console.log(this.navParams.get('cat_id'))
if (this.navParams.get('cat_id')!=null && this.navParams.get('cat_id') !=undefined) {
this.category_id = this.navParams.get('cat_id');
}
openPages(cat_id:number = 0) {
this.navCtrl.setRoot(BlogsPage, {cat_id: cat_id})
}
.html
<ion-list>
<ion-item *ngFor="let cat of api.Categories" text-wrap (click)="openPages(cat_id)" menuClose>
<h2> {{ cat.name }} </h2>
</ion-item>
</ion-list>
Please help???