当前位置: 首页>>代码示例>>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;未经允许,请勿转载。