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


TypeScript LoadingController.create方法代码示例

本文整理汇总了TypeScript中ionic-angular.LoadingController.create方法的典型用法代码示例。如果您正苦于以下问题:TypeScript LoadingController.create方法的具体用法?TypeScript LoadingController.create怎么用?TypeScript LoadingController.create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ionic-angular.LoadingController的用法示例。


在下文中一共展示了LoadingController.create方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: constructor

  constructor(public platform: Platform, public navCtrl: NavController, public user:User, public push: Push, public navParams: NavParams, storage: Storage, public af: AngularFire, public loadingCtrl:LoadingController) {



  	// CARICA TUTTE LE GARE NEL DATABASE
    let loader = this.loadingCtrl.create({
    content: "Attendere il caricamento delle gare..."
    });
    loader.present();
    this.gare = af.database.object('/gare', { preserveSnapshot: true  });
    this.gare.subscribe(snapshot => {
        storage.set('gareDB', snapshot.val());
        this.navCtrl.setRoot(Page1)
        
    });
    this.gare.subscribe(() => loader.dismissAll());

    if (this.platform.is('android')) {  
      this.push.register().then((t: PushToken) => {
         return this.push.saveToken(t);
      }).then((t: PushToken) => {
         this.notificheSnap = this.af.database.object('/utenti/'+this.user.id+'/notifiche/', { preserveSnapshot: true });
         this.notificheSnap.set({pushToken:t.token});
      });
    }

    
  }
开发者ID:gianmichelesiano,项目名称:Bandigare,代码行数:28,代码来源:aggiorna.ts

示例2: loginProject

    loginProject() {
        let loader = this.loadingCtrl.create({
            content: "登录中..."
        });
        loader.present();

        if (this.platform.is('android')) {
            HNBridge.loginProject(() => {
                loader.dismiss();
                HNBridge.gotoPage("project-main");
            }, () => {
            }, this.commonHttpService.accountInfo.account, this.commonHttpService.accountInfo.password);
        } else {
            this.projectService.login().subscribe(info => {
                loader.dismiss();
                this.platform.ready().then(() => {
                    HNBridge.setAccountId(info.accountId, parseInt(info.roleId) === 9);
                    HNBridge.gotoPage("project-main");
                    this.projectService.startGetLocation();
                });
            }, error => {
                loader.dismiss();
            });
        }
    }
开发者ID:qwb0920,项目名称:TaxiBus,代码行数:25,代码来源:home.ts

示例3: ionViewLoaded

  ionViewLoaded() {
    console.log("Entro al catalogo");
    let loading = this.loadingController.create({
      content: "Obteniendo encuestas"
    });
    loading.present();
    this.prizeList = this.surveyProvider.getPrizesObtained(this.userData);
    loading.dismiss();
    /* 
    .then((data) => {
      this.catalog = <[Prize]>data;
      loading.dismiss();
    }, (err) => {
      loading.dismiss();
      let alert = this.alertCtrl.create({
        title: 'Equipos Pregunta',
        subTitle: 'Error al obtener encuestas',
        buttons: [{
          text: 'cancel',
          role: 'canel'

        }]
      });
      alert.present();

      console.log(err);
    });
   */

  }
开发者ID:araujomelogno,项目名称:EquiposPregunta,代码行数:30,代码来源:prize-list.ts

示例4: uploadPhoto

  async uploadPhoto(imageFileUri: any): Promise<void> {
    this.myPhoto = imageFileUri;

    this.error = null;
    this.loading = this.loadingCtrl.create({
      content: 'Uploading...'
    });

    await this.loading.present();

    const fileTransfer: FileTransferObject = this.transfer.create();

    const fileEntry = await this.file.resolveLocalFilesystemUrl(imageFileUri);

    const options: FileUploadOptions = {
      fileKey: 'file',
      fileName: fileEntry.name,
      headers: {}
    };

    try {
      const result = await fileTransfer.upload(imageFileUri, 'http://192.168.178.84:8080/upload', options);
      console.log(result.bytesSent);
      console.log(result.responseCode);
      this.showToast(true);
    }
    catch (e) {
      console.log(e);
      this.showToast(false);
    }
    finally {
      this.loading.dismiss();
    }
  }
开发者ID:ralscha,项目名称:attic,代码行数:34,代码来源:home.ts

示例5: presentLoading

 presentLoading() {
   this.loadingCtrl.create({
     content: 'Please wait...',
     duration: 3000,
     dismissOnPageChange: true
   }).present();
 }
开发者ID:Kode-Kitchen,项目名称:ionic-preview-app,代码行数:7,代码来源:pages.ts

示例6: cargarDetalle

 private cargarDetalle(vendedor: string, anno: number, mes: number,
   incluirAlbaranes: boolean, etiqueta: string) {
   let loading: any = this.loadingCtrl.create({
     content: 'Cargando Comisiones...',
   });
   loading.present();
   this.servicio.cargarDetalle(vendedor, anno, mes, incluirAlbaranes, etiqueta)
     .subscribe(
         data => {
           if (data.length === 0) {
             let alert = this.alertCtrl.create({
               title: 'Error',
               subTitle: 'No se han cargado correctamente las comisiones',
               buttons: ['Ok'],
             });
             alert.present();
           } else {
             this.listaDetalleComision = data;
           }
         },
         error => {
           loading.dismiss();
         },
         () => {
           loading.dismiss();
         }
   )
 }
开发者ID:CarlosAdrianM,项目名称:NestoApp,代码行数:28,代码来源:ComisionesDetalle.component.ts

示例7: toggleVoid

  toggleVoid() {

    const voidText = 'Are you sure you want to void this transaction? It will re-stock the items listed in the invoice.';
    const unvoidText = 'Are you sure you want to un-void this transaction? It will again deduct the items listed in the invoice.';

    const loading = this.loadingCtrl.create({
      content: 'Please wait...'
    });

    const confirm = this.alertCtrl.create({
      title: `${this.invoice.isVoided ? 'Un-void' : 'Void'} Invoice?`,
      message: this.invoice.isVoided ? unvoidText : voidText,
      buttons: [
        {
          text: 'Cancel'
        },
        {
          text: 'Confirm',
          handler: () => {
            loading.present();

            this.ivService
              .toggleVoid(this.invoice)
              .toPromise()
              .then(res => {
                this.invoice.isVoided = res.isVoided;
                loading.dismiss();
              });
          }
        }
      ]
    });

    confirm.present();
  }
开发者ID:Linko91,项目名称:posys,代码行数:35,代码来源:invoice.view.ts

示例8: showLoading

 showLoading() {
   let loading = this.loadingCtrl.create({
     content: 'Loading...',
     duration: 3000
   });
   loading.present();
 }
开发者ID:jgw96,项目名称:provider-usage-example,代码行数:7,代码来源:ajax.ts

示例9: fetchNews

 //TODO FIX TWICE BUTTON CLICK
 fetchNews(date){
     var loader = this.loadingCtrl.create({
         content: "Loading news...",
     });
     loader.present().then(()=> {
         console.log("fetchNews");
         var y = date.getFullYear();
         var m = ("0" + (date.getMonth() + 1)).slice(-2);
         var d = ("0" + date.getDate()).slice(-2);
         this.http.get("http://apollo_ror.slapps.fr/news.json?date="+y+m+d).map(res => res.json()).subscribe(data => {
             this.news = [];
             console.log(data);
             for(var i=0;i<data.length;i++){
                 this.news.push({
                     title: data[i].title,
                     source: data[i].source,
                     image_link: data[i].image_link,
                     datetime:new Date(data[i].date),
                     link:data[i].link
                 });
             };
             this.updateNews();
             loader.dismiss();
         });
     });
 }
开发者ID:stevenluong,项目名称:apollo,代码行数:27,代码来源:list.ts

示例10: signInWithEmail

  signInWithEmail() {
    const loading = this.loadingCtrl.create({
      content: 'Por favor, aguarde...'
    });
    loading.present();

    this.auth.signInWithEmailAndPassword(this.form.value.email, this.form.value.password)
    .then(() => {
      loading.dismiss();
      this.navCtrl.setRoot('tabs');
    }, (error) => {
      loading.dismiss();
      switch (error.code) {
        case 'auth/invalid-email':
          this.errorMessage = 'Insira um email válido.';
          break;
        case 'auth/wrong-password':
          this.errorMessage = 'Combinação de usuário e senha incorreta.';
          break;
        case 'auth/user-not-found':
          this.errorMessage = 'Combinação de usuário e senha incorreta.';
          break;
        default:
          this.errorMessage = error;
          break;
      }
      this.hasError = true;
    });
  }
开发者ID:squadsea,项目名称:ionic3-angularfire-login,代码行数:29,代码来源:signin.ts

示例11: feedbackSubmit

  feedbackSubmit(){
    this.loading = this.loadingCtrl.create({
      content: 'Please Wait...'
    });
    this.loading.present();
    let data = { "subject":this.subject,"remarks":this.remarks, "user_id":this.user_id,"send_file":""}
    console.log(data);
    this.apiservice.feedback(data).then((result) => {
      this.responseData = result;
      if(this.responseData.status){
        this.loading.dismiss();
        let toast = this.toastCtrl.create({
          message: 'Feedback Submitted Successfully',
          duration: 5000,
          position: 'top'
        });
        toast.present();
        this.navCtrl.setRoot(this.navCtrl.getActive().component);
      }else{
        this.loading.dismiss();
        let toast = this.toastCtrl.create({
          message: 'Error! Please send feedback again.',
          duration: 5000,
          position: 'top'
        });
        toast.present();
       
      }
    });

  }
开发者ID:Swapinfotech,项目名称:jainsampark,代码行数:31,代码来源:feedback.ts

示例12: uploadFile

 uploadFile() {
   let loader = this.loadingCtrl.create({
     content: "Uploading..."
   });
   loader.present();
   const fileTransfer: FileTransferObject = this.transfer.create();
 
   let options: FileUploadOptions = {
     fileKey: 'ionicfile',
     fileName: 'ionicfile',
     chunkedMode: false,
     mimeType: "image/jpeg",
     headers: {}
   }
 
   fileTransfer.upload(this.imageURI, 'http://192.168.0.7:8080/api/uploadImage', options)
     .then((data) => {
     console.log(data+" Uploaded Successfully");
     this.imageFileName = "http://192.168.0.7:8080/static/images/ionicfile.jpg"
     loader.dismiss();
     this.presentToast("Image uploaded successfully");
   }, (err) => {
     console.log(err);
     loader.dismiss();
     this.presentToast(err);
   });
 }
开发者ID:tinchoas19,项目名称:app-upload-camera,代码行数:27,代码来源:home.ts

示例13: getCurrentLocation

  getCurrentLocation(): Observable<google.maps.LatLng> {
    
    let loading = this.loadingCtrl.create({
      content: 'Locating...'
    });
    
    loading.present(loading);
    
    let options = {timeout: 10000, enableHighAccuracy: true};
    
    let locationObs = Observable.create(observable => {
      
      Geolocation.getCurrentPosition(options)
        .then(resp => {
          let lat = resp.coords.latitude;
          let lng = resp.coords.longitude;
          
          let location = new google.maps.LatLng(lat, lng);
          
          console.log('Geolocation: ' + location);
          
          observable.next(location);
          
          loading.dismiss();
        },
        (err) => {
          console.log('Geolocation err: ' + err);
          loading.dismiss();
        })

    })
    
    return locationObs;
  }
开发者ID:ayrokid,项目名称:Ionic-2-Uber,代码行数:34,代码来源:map.ts

示例14: signInWithEmail

  signInWithEmail() {
    const loading = this.loadingCtrl.create({
      content: 'Please wait...'
    });
    loading.present();

    this.auth.signInWithEmailAndPassword(this.form.value.email, this.form.value.password)
    .then((data) => {
      console.log("uid",data.uid);
      loading.dismiss();
      this.navCtrl.setRoot('tabs');
    }, (error) => {
      loading.dismiss();
      switch (error.code) {
        case 'auth/invalid-email':
          this.errorMessage = 'Please enter a valid email address.';
          break;
        case 'auth/wrong-password':
          this.errorMessage = 'Incorrect username and password combination.';
          break;
        case 'auth/user-not-found':
          this.errorMessage = 'user not found Contcat suppor team';
          break;
        default:
          this.errorMessage = error;
          break;
      }
      this.hasError = true;
    });
  }
开发者ID:mbibekjana,项目名称:nafisa_capital,代码行数:30,代码来源:signin.ts

示例15: signInWithEmail

  signInWithEmail() {
    const loading = this.loadingCtrl.create({
      content: 'Por favor, aguarde...'
    });
    loading.present();

    this.auth.sendPasswordResetEmail(this.form.value.email).then(() => {
      loading.dismiss();
      this.hasError = false;
      this.emailSent = true;
    }, (error) => {
      loading.dismiss();
      switch (error.code) {
        case 'auth/invalid-email':
          this.errorMessage = 'Insira um email válido.';
          break;
        case 'auth/user-not-found':
          this.errorMessage = 'Nenhum usuário com este email encontrado.';
          break;
        default:
          this.errorMessage = error;
          break;
      }
      this.hasError = true;
    });
  }
开发者ID:squadsea,项目名称:ionic3-angularfire-login,代码行数:26,代码来源:password.ts


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