Skip to content

Instantly share code, notes, and snippets.

@amandeepmittal
Created August 10, 2017 16:22
Show Gist options
  • Save amandeepmittal/4eb3db8e5346f05129b5d11688956905 to your computer and use it in GitHub Desktop.
Save amandeepmittal/4eb3db8e5346f05129b5d11688956905 to your computer and use it in GitHub Desktop.
import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular';
import { Page2Page } from "../page2/page2";
@IonicPage()
@Component({
selector: 'page-page1',
templateUrl: 'page1.html',
})
export class Page1Page {
constructor(public navCtrl: NavController, public navParams: NavParams) {
}
goTo(page) {
if(page === 'page2') {
this.navCtrl.push(Page2Page);
}
}
back() {
if(this.navCtrl.length() >= 2) {
this.navCtrl.pop();
}
}
ionViewDidLoad() {
console.log('ionViewDidLoad Page1Page');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment