import { Component , ViewChild } from '@angular/core' ; import { IonicPage , MenuController , Nav } from '../../../../../..' ; import { PageTwo } from '../page-two/page-two' ; @ IonicPage ( ) @ Component ( { templateUrl : 'page-one.html' } ) export class PageOne { rootPage : any ; changeDetectionCount : number = 0 ; pages : Array < { title : string ; component : any ; } > ; @ ViewChild ( Nav ) nav : Nav ; constructor ( public menuCtrl ) { this . rootPage = PageTwo ; this . pages = [ { title : 'Page 1' , component : PageTwo } , { title : 'Page 2' , component : 'PageThree' } , { title : 'Page 3' , component : 'PageFour' } , ] ; } openPage ( page ) { this . nav . setRoot ( page . component ) . then ( ( ) => { this . menuCtrl . close ( ) ; } ) ; } openRightMenu ( ) { this . menuCtrl . open ( 'right' ) ; } openLeftMenu ( ) { this . menuCtrl . open ( 'left' ) ; } onDrag ( ev ) { console . log ( 'Menu is being dragged' , ev ) ; } onOpen ( ev ) { console . log ( 'Menu is open' , ev ) ; } onClose ( ev ) { console . log ( 'Menu is closed' , ev ) ; } isChangeDetecting ( ) { console . log ( 'Change detection' , ++ this . changeDetectionCount ) ; return true ; } }