當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript ionic-angular.App類代碼示例

本文整理匯總了TypeScript中ionic-angular.App的典型用法代碼示例。如果您正苦於以下問題:TypeScript App類的具體用法?TypeScript App怎麽用?TypeScript App使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了App類的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: 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.emailLogin=true;
            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,代碼行數:19,代碼來源:error.ts

示例2: if

this.kakaoProvider.login().then((res:any)=>{
        console.log("MyApp:"+JSON.stringify(res));
        if(res.result=="success"){
            //save shoplist
            if(res.userInfo.hasOwnProperty("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.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:"kakao"});
        }else{
            console.log("invalid result comes from server-"+JSON.stringify(res));
            //this.storageProvider.errorReasonSet('로그인 에러가 발생했습니다');
            //this.app.getRootNav().setRoot(ErrorPage);   
        }
    },login_err =>{
開發者ID:raceyi,項目名稱:takit,代碼行數:22,代碼來源:error.ts

示例3: 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

示例4: 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

示例5: 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

示例6: productClick

  private productClick(e: any, shopTypeId: string, shopId: string): void {
    // console.debug('our product :', e);

    this.appCtrl.getRootNav().push('ProductPage', {
      ...this.navParams.data,
      productId: e.product.id,
      productItemId: e.product.refProduct instanceof ProductItemModel ? e.product.id : undefined,
      shopTypeId,
      shopId,
    });
  }
開發者ID:PoompisekK,項目名稱:myWork,代碼行數:11,代碼來源:organization-home.page.ts

示例7: handleError

  //Function to handle Errors
  handleError(error, expected?) {

    //TODO: Allow for overiding error codes, and using custom callbacks

    //Log the error
    console.log(error);

    //Get our status
    let status = error.status;

    //Check if we have any callbacks for specific error codes
    if (expected) {
      for (let i = 0; i < expected.length; ++i) {
        if (expected[i].status == status) {

          //Launch the call abck and return
          expected[i].callback();
          return;
        }

      }
    }

    if (status == 400) {
      //400 Bad Request
      this.showToast('Bad Request. Please ensure your input is correct.');
    } else if (status == 401) {
      //401 Unauthorized

      //Logout
      this.appAuth.logout();

      //Redirect to home
      let nav = this.app.getActiveNav();
      nav.setRoot(Home);

      //Toast the user
      this.showToast('Unauthorized. Please log back in.');
    } else if (status == 404) {

      //Toast the user
      this.showToast('Could not be found. Please ensure your input is complete and correct.');

    } else if (status == 500) {
      //Internal Server Error

      //Toast the user
      this.showToast('Internal Server Error. Please try making the request again, or at a later time.');
    } else {
      this.showToast('Error ' + status + ': Please Contact Developers for help.');
    }


  }
開發者ID:pro-to-tip,項目名稱:pro-to-tip.github.io,代碼行數:55,代碼來源:app-notify.ts

示例8:

 this.nativeStorage.getItem("id").then((value:string)=>{
         console.log("value:"+value);
         if(value==null){
             console.log("id doesn't exist");
             this.app.getRootNav().setRoot(LoginPage); 
             return;
         }else{
             var id=this.storageProvider.decryptValue("id",decodeURI(value));
             console.log("id:"+id);
             this.loginWithExistingId();
         }
 });        
開發者ID:raceyi,項目名稱:takit,代碼行數:12,代碼來源:error.ts

示例9: expandChartModalLimitsAndExposures

  //open Chart in full screen
  expandChartModalLimitsAndExposures() {

    // Get the same chart data on this page and set title
    let chartData = this.chartLimitsAndExposureData;
    chartData.title = { text: this.cpInfo.name };
    chartData.subtitle = { text: 'Limits & Exposures'};

    this.app.getRootNav().push(OnlyChartPage, { "chartData": chartData });

    
    //let modal = this.modalCtrl.create(ChartModalPage, { "chartData": chartData });
    //modal.onDidDismiss(()=>{
    //});

    //modal.present();
    
  }
開發者ID:letuthanhson,項目名稱:ionic,代碼行數:18,代碼來源:counterparty-info.ts

示例10: nav

 private get nav() {
   return this.app.getActiveNav();
 }
開發者ID:PedalPi,項目名稱:Apk,代碼行數:3,代碼來源:navigator.ts


注:本文中的ionic-angular.App類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。