Created
September 23, 2018 20:24
-
-
Save zaqueo/0f3e263ca6513cf37b559ef82dce6db9 to your computer and use it in GitHub Desktop.
Go to another page with a button click with ionic
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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