本文整理汇总了TypeScript中ionic-angular.App.getRootNav方法的典型用法代码示例。如果您正苦于以下问题:TypeScript App.getRootNav方法的具体用法?TypeScript App.getRootNav怎么用?TypeScript App.getRootNav使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ionic-angular.App
的用法示例。
在下文中一共展示了App.getRootNav方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1:
this.serverProvider.post(this.storageProvider.serverAddress+"/preventMultiLogin",body).then((res:any)=>{
console.log("res:"+JSON.stringify(res));
if(res.result=="success"){
// move into TabPage
if(res.userInfo.hasOwnProperty("shopList")){
this.storageProvider.shoplistSet(JSON.parse(res.userInfo.shopList));
}
//save this.storageProvider.id
this.storageProvider.userInfoSetFromServer(res.userInfo);
//save id information into storage
let id=this.navParams.get("id");
if(id!=undefined){
var encrypted:string=this.storageProvider.encryptValue('id',id);
this.nativeStorage.setItem('id',encodeURI(encrypted));
this.storageProvider.id=id;
}else{
//read id info and then save it into storageProvider
this.nativeStorage.getItem("id").then((value:string)=>{
this.storageProvider.id=this.storageProvider.decryptValue("id",decodeURI(value));
});
}
console.log("move into TbasPage");
this.app.getRootNav().setRoot(TabsPage);
}else{
console.log("move into LoginPage");
// move into loginPage
this.storageProvider.reset();
this.app.getRootNav().setRoot(LoginPage);
}
});
示例2: if
this.fbProvider.login().then((res:any)=>{
console.log("MyApp:"+JSON.stringify(res));
if(res.result=="success"){
//save shoplist
console.log("res.email:"+res.email +"res.name:"+res.name);
if(res.userInfo.hasOwnProperty("shopList")){
this.storageProvider.shoplistSet(JSON.parse(res.userInfo.shopList));
}
this.storageProvider.emailLogin=false;
this.storageProvider.userInfoSetFromServer(res.userInfo);
console.log("shoplist...:"+JSON.stringify(this.storageProvider.shoplist));
this.app.getRootNav().setRoot(TabsPage);
}else if(res.result=='failure' && res.result=='invalidId'){
console.log("사용자 정보에 문제가 발생했습니다. 로그인 페이지로 이동합니다.");
this.app.getRootNav().setRoot(LoginPage);
}else if(res.result=='failure'&& res.error=='multiLogin'){
// How to show user a message here? move into error page?
// Is it possible to show alert here?
this.app.getRootNav().setRoot(MultiloginPage,{id:"facebook"});
}else{
console.log("invalid result comes from server-"+JSON.stringify(res));
//this.storageProvider.errorReasonSet('로그인 에러가 발생했습니다');
this.app.getRootNav().setRoot(ErrorPage);
}
},login_err =>{
示例3: reject
(error: any, caught: Observable<void>) => {
reject("network error")
loader.dismiss()
this.app.getRootNav().pop()
this.toastService.showText("serverUnreachable")
return []
}
示例4: logoutUserOut
logoutUserOut() {
this.menu.close();
window.sessionStorage.setItem("tokenid", '');
let nav = this.app.getRootNav()
nav.setRoot(LoginPage);
}
示例5: startTakit
startTakit(){
console.log("startTakit");
this.storageProvider.tutorialShownFlag=true;
// if(this.navCtrl.canGoBack())
// this.navCtrl.pop();
// else
this.app.getRootNav().setRoot(LoginPage);
}
示例6: groupEventClick
private groupEventClick(e: any): void {
// console.debug('courseClick :', e);
this.appCtrl.getRootNav().push('ProductPage', {
...this.navParams.data,
productId: e.product.id,
productItemId: e.product.refProduct.itemId,
shopTypeId: this.shopTypeId,
});
}
示例7: if
this.emailProvider.EmailServerLogin(id,password).then((res:any)=>{
console.log("MyApp:"+JSON.stringify(res));
if(res.result=="success"){
if(res.userInfo.hasOwnProperty("shopList")){
//save shoplist
this.storageProvider.shoplistSet(JSON.parse(res.userInfo.shopList));
}
this.storageProvider.userInfoSetFromServer(res.userInfo);
this.app.getRootNav().setRoot(TabsPage);
}else if(res.result=='failure'&& res.error=='multiLogin'){
// How to show user a message here? move into error page?
// Is it possible to show alert here?
this.app.getRootNav().setRoot(MultiloginPage,{id:id});
}else{
console.log("사용자 정보에 문제가 발생했습니다. 로그인 페이지로 이동합니다.");
this.app.getRootNav().setRoot(LoginPage);
}
},login_err =>{
示例8: resumeTransaction
resumeTransaction(isReturn = false) {
const rootNav = this.appCtrl.getRootNav();
rootNav
.popToRoot()
.then(() => {
this.dismiss();
rootNav.push(PointOfSalePageComponent, { prevInvoice: this.invoice, isReturn });
});
}
示例9: resolve
(response: any) => {
if (response.meta.return_code == 0) {
if (response.data) {
resolve(response.data)
loader.dismiss()
} else {
reject("bad request")
loader.dismiss()
this.app.getRootNav().pop()
this.toastService.showText("serverUnreachable")
}
} else {
reject("bad request")
loader.dismiss()
this.app.getRootNav().pop()
this.toastService.showString("Error " + response.meta.return_code + ", server says: " + response.meta.message)
}
},
示例10: resolve
(response: any) => {
if (response.meta.return_code == 0) {
if (response.data) {
resolve(response.data)
this.storage.set("log-" + suffix, response.data)
logLoader.dismiss()
} else {
reject("bad request")
logLoader.dismiss()
this.app.getRootNav().pop()
this.toastService.showText("serverUnreachable")
}
} else {
reject("bad request")
logLoader.dismiss()
this.app.getRootNav().pop()
this.toastService.showString("Error " + response.meta.return_code + ", server says: " + response.meta.message)
}
}, (error: any, caught: Observable<void>) => {