当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript App.getRootNav方法代码示例

本文整理汇总了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);
     }
 });
开发者ID:raceyi,项目名称:takit,代码行数:30,代码来源:multilogin.ts

示例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 =>{
开发者ID:raceyi,项目名称:takit,代码行数:25,代码来源:error.ts

示例3: reject

 (error: any, caught: Observable<void>) => {
   reject("network error")
   loader.dismiss()
   this.app.getRootNav().pop()
   this.toastService.showText("serverUnreachable")
   return []
 }
开发者ID:caom92,项目名称:Espresso,代码行数:7,代码来源:app.inventory.ts

示例4: logoutUserOut

  logoutUserOut() {

    this.menu.close();
    window.sessionStorage.setItem("tokenid", '');
    let nav = this.app.getRootNav()
    nav.setRoot(LoginPage);
    
  }
开发者ID:artman202,项目名称:tangent-app,代码行数:8,代码来源:app.ts

示例5: startTakit

  startTakit(){
   console.log("startTakit");
   this.storageProvider.tutorialShownFlag=true;
 //  if(this.navCtrl.canGoBack())
 //      this.navCtrl.pop();
 //  else
       this.app.getRootNav().setRoot(LoginPage);    
 }
开发者ID:raceyi,项目名称:takit,代码行数:8,代码来源:tutorial-last.ts

示例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,
   });
 }
开发者ID:PoompisekK,项目名称:myWork,代码行数:9,代码来源:group-event.page.ts

示例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 =>{
开发者ID:raceyi,项目名称:takit,代码行数:18,代码来源:error.ts

示例8: resumeTransaction

 resumeTransaction(isReturn = false) {
   const rootNav = this.appCtrl.getRootNav();
   rootNav
     .popToRoot()
     .then(() => {
     this.dismiss();
       rootNav.push(PointOfSalePageComponent, { prevInvoice: this.invoice, isReturn });
     });
 }
开发者ID:Linko91,项目名称:posys,代码行数:9,代码来源:invoice.view.ts

示例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)
   }
 },
开发者ID:caom92,项目名称:Espresso,代码行数:18,代码来源:app.inventory.ts

示例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>) => {
开发者ID:caom92,项目名称:Espresso,代码行数:19,代码来源:app.logs.ts


注:本文中的ionic-angular.App.getRootNav方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。