12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- import { Component, ViewChild } from '@angular/core';
- import { Nav, Platform } from 'ionic-angular';
- import { StatusBar } from 'ionic-native';
- import { Login } from '../pages/login/login';
- import { Page1 } from '../pages/page1/page1';
- import { Page2 } from '../pages/page2/page2';
- @Component({
- templateUrl: 'app.html'
- })
- export class MyApp {
- @ViewChild(Nav) nav: Nav;
- rootPage: any = Login;
- pages: Array<{title: string, component: any}>;
- constructor(public platform: Platform) {
- this.initializeApp();
- // used for an example of ngFor and navigation
- this.pages = [
- { title: 'Page One', component: Page1 },
- { title: 'Page Two', component: Page2 }
- ];
- }
- 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.
- StatusBar.styleDefault();
- });
- }
- 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);
- }
- }
|