import { Component , ViewChild } from '@angular/core' ; import { Platform , MenuController , Nav , App } from 'ionic-angular' ; import { StatusBar } from '@ionic-native/status-bar' ; import { SplashScreen } from '@ionic-native/splash-screen' ; import { LearnFeedPage } from '../pages/learn-feed/learn-feed' ; @ Component ( { selector : 'app-root' , templateUrl : 'app.html' } ) export class MyApp { @ ViewChild ( Nav ) nav : Nav ; rootPage : any = LearnFeedPage ; pages : Array < { title : string ; component : any ; params : any ; } > ; constructor ( platform , statusBar , splashScreen , public menu , public app ) { platform . ready ( ) . then ( ( ) => { statusBar . styleDefault ( ) ; splashScreen . hide ( ) ; } ) ; this . pages = [ { title : 'All' , component : LearnFeedPage , params : { query : 'all' } } , { title : 'Basic' , component : LearnFeedPage , params : { query : 'basic' } } , { title : 'Core' , component : LearnFeedPage , params : { query : 'core' } } ] ; } openPage ( page ) { this . menu . close ( ) ; this . nav . setRoot ( page . component , page . params ) ; } }