APP.html
<ion-menu [content]=“content”>
Menu
<button menuClose ion-item *ngFor="let p of pages" (click)="openPage(p)"> <ion-icon item-left [name]="p.icon"></ion-icon>
{{p.title}}
</button>
</ion-content>
<ion-nav [root]=“rootPage” #content swipeBackEnabled=“false”>
app.component.ts
import { Component, ViewChild } from ‘@angular/core’;
import { Nav, Platform } from ‘ionic-angular’;
import { StatusBar } from ‘@ionic-native/status-bar’;
import { SplashScreen } from ‘@ionic-native/splash-screen’;
import { VATExpert } from ‘…/pages/home/home’;
import { EventCalendar } from ‘…/pages/eventcalendar/calendar’;
import { VATinGCC } from ‘…/pages/vatingcc/vatingcc’;
import { MyVATJourney } from ‘…/pages/myvatjourney/vatjourney’;
import { VATCalculator } from ‘…/pages/vatcalculator/calculator’;
import { ContactUs } from ‘…/pages/contactus/contact’;
import { SignOut } from ‘…/pages/signout/signout’;
import {Login} from’…/pages/login/login’;
//import { LiveChat } from ‘…/pages/livechat/chat’;
@Component({
templateUrl: ‘app.html’
})
export class MyApp {
@ViewChild(Nav) nav: Nav;
rootPage: any = Login;
pages: Array<{title: string, component: any, Icon: any}>;
constructor(public platform: Platform, public statusBar: StatusBar, public splashScreen: SplashScreen) {
this.initializeApp();
// used for an example of ngFor and navigation
this.pages = [
{ title: 'Event Calendar', component: EventCalendar, Icon :'ios-home-outline' },
{ title: 'VAT in GCC', component: VATinGCC , Icon :'ios-home-outline' },
{ title: 'My VAT Journey', component: MyVATJourney , Icon : 'ios-home-outline'},
{ title: 'VAT Calculator', component: VATCalculator , Icon : 'ios-home-outline' },
{ title: 'Contact Us', component: ContactUs , Icon : 'ios-home-outline'},
{ title: 'Sign Out', component: SignOut , Icon :'ios-home-outline' }
];
}
initializeApp() {
this.platform.ready().then(() => {
// Okay, so the platform is ready and our plugins are available.
// Here you can do any higher level native things you might need.
this.statusBar.styleDefault();
this.splashScreen.hide();
});
}
openPage(page) {
// Reset the content nav to have just this page
// we wouldn’t want the back button to show in this scenario
this.nav.setRoot(page.component);
}
}