[英]How to redirect in ionic2
Basically i have explored how we can use get and post in api's using ionic2. 基本上我已经探索了如何使用ionic2在api的get和post中使用。
But i have been stucked seriously on how to go to welcome screen after authentication. 但是我一直在认真对待认证后如何进入欢迎屏幕。
This is my html: 这是我的html:
<ion-content>
<ion-list>
<ion-label>Username</ion-label>
<input type="text" name="username" [(ngModel)]="model.username">
<ion-label>Password</ion-label>
<input type="password" name="password" [(ngModel)]="model.password"><br><br><br>
<button round block (click)="submit()">Submit</button>
</ion-list>
</ion-content>
on your ts file 在您的ts文件中
import your welcome screen class and write the below function 导入您的欢迎屏幕类并编写以下功能
import { NavController } from 'ionic-angular';
constructor(public navCtrl:NavController){}
submit(){
this.navCtrl.push(WelcomeScreen,{});
}
you can use push pop and setRoot depending upon your need to know more about navigation in ionic please refer this link http://ionicframework.com/docs/v2/api/navigation/NavController . 您可以根据需要了解更多有关ionic导航的信息,使用push pop和setRoot,请参考此链接http://ionicframework.com/docs/v2/api/navigation/NavController 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.