Skip to content

Instantly share code, notes, and snippets.

@zaqueo
Created September 23, 2018 20:24
Show Gist options
  • Save zaqueo/0f3e263ca6513cf37b559ef82dce6db9 to your computer and use it in GitHub Desktop.
Save zaqueo/0f3e263ca6513cf37b559ef82dce6db9 to your computer and use it in GitHub Desktop.
Go to another page with a button click with ionic
html:
<ion-buttons>
<button ion-button (click)="goAnOtherPage()">Go an Other Page </button>
</ion-buttons>
OR
<ion-label [navPush]="anOtherPage">Go an Other Page</ion-label>
in TS:
import { NavController } from 'ionic-angular';
import { AnOtherPage } from '/anOtherPage';
anOtherPage: AnOtherPage;
constructor(public navCtrl: NavController) {}
goAnOtherPage() {
this.navCtrl.setRoot(anOtherPage);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment