import { Component , ViewChild } from '@angular/core' ; import { IonicPage , MenuController , Nav } from '../../../../../..' ; @ IonicPage ( { name : 'page-one' } ) @ Component ( { templateUrl : 'page-one.html' } ) export class PageOne { rootPage : any ; changeDetectionCount : number = 0 ; pages : Array < { title : string ; component : any ; } > ; @ ViewChild ( Nav ) nav : Nav ; constructor ( private menu ) { this . rootPage = 'page-two' ; this . pages = [ { title : 'Page 1' , component : 'page-two' } , { title : 'Page 2' , component : 'page-two' } , { title : 'Page 3' , component : 'page-two' } , ] ; } openPage ( page ) { this . nav . setRoot ( page . component ) . then ( ( ) => { this . menu . close ( ) ; } ) ; } }