當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。