I'm trying to understand how navigations between pages with ionic2
work. I want that by clicking the button below it redirects me to HomePage
, how can I do this?
Button in menu.html
<button ion-button color="light">Button</button>
My .ts
@Component({
selector: 'page-menu',
templateUrl: 'menu.html',
})
export class MenuPage {
constructor(public navCtrl: NavController, public navParams: NavParams, public alertCtrl: AlertController) {
}
showAlert() {
const alert = this.alertCtrl.create({
title: 'New Friend!',
subTitle: 'teste',
buttons: ['OK']
});
alert.present();
}
openSobre(){
this.navCtrl.push(HomePage, {}, {animate: true} );
}
ionViewDidLoad() {
console.log('ionViewDidLoad MenuPage');
}
}