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