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


TypeScript Loading.dismiss方法代碼示例

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


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

示例1: checkAllLoaded

 checkAllLoaded() {
   if (this.areNeedsRetrieved && this.areResponsesRetrieved) {
     this.mungedNeeds = this.needs
       .map((n) => {
         const responses = this.responses
           .filter((r) => r.needId === n.id)
           .map((r) => {
             return {
               ...r,
               formattedCreationDate: new Date(r.creationDate).toLocaleDateString(),
               mailLink: `mailto:${r.email}?subject=Thanks for your offer to help with "${htmlDecode(n.description)}"`
             }
           })
         return {
           ...n,
           responses: responses,
           hasResponses: responses.length > 0,
           responsesLabel: responses.length === 1
             ? `${responses.length} response`
             : `${responses.length} responses`
         }
       })
     this.loader.dismiss()
   }
 }
開發者ID:StreetSupport,項目名稱:streetsupport-app,代碼行數:25,代碼來源:needs.ts

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

示例3:

        this.geolocation.getCurrentPosition().then((position) => {

            let latLng = new google.maps.LatLng(position.coords.latitude, position.coords.longitude);

            let mapOptions = {
                center: latLng,
                zoom: 15,
                mapTypeId: google.maps.MapTypeId.ROADMAP
            }

            this.map = new google.maps.Map(this.mapElement.nativeElement, mapOptions);

            this.addMarkers();

            this.addMyMarker();

            /*let myMarker = new google.maps.Marker({
                map: this.map,
                animation: google.maps.Animation.DROP,
                position: latLng,
            });

            let myContent = "IO";

            this.addInfoWindow(myMarker, myContent);*/

            this.loading.dismiss()
            console.log('fine caricamento mappa')

        }, (err) => {
開發者ID:creattico,項目名稱:petrolcompany2,代碼行數:30,代碼來源:mappa.ts

示例4:

 .catch ( (err: AuthError) => {
   console.log(err);
   this.analytics.trackEvent('Login', 'Submit', 'Failed');
   this.loading.dismiss().then( () => {
     if (err) {
       if (err.message === 'passwordExpired') {
         this.updatePassword(user.value.email, user.value.password)
         .then(() => {
           console.log('UpdatePassword resolved');
           this.navCtrl.setRoot('HomePage');
         })
         .catch(() => {
           console.log('UpdatePassword rejected');
         });
         return;
       }
       const alert = this.alertCtrl.create({
         message: this.translateService.instant(err.message),
         buttons: [
           {
             text: 'Ok',
             role: 'cancel'
           }
         ]
       });
       alert.present();
     }
   });
 });
開發者ID:meumobi,項目名稱:infomobi,代碼行數:29,代碼來源:login.ts

示例5: hideLoading

 public hideLoading(): Promise<any> {
   return (this.loading && this.loading.dismiss().then(() => {
     this.loading = null;
   })) || new Promise((resolve, reject) => resolve({})).then(() => {
     this.loading = null;
   });
 }
開發者ID:PoompisekK,項目名稱:myWork,代碼行數:7,代碼來源:app-loading.service.ts

示例6: resolve

        .subscribe(data => {
          // we've got back the raw data, now generate the core schedule data
          // and save the data for later reference

          //dismiss the loader and return response back.
          this.loading.dismiss().then(() => resolve(data));

        }, (error) => {
開發者ID:snowflakekiller,項目名稱:ionic2-common-rest-provider-sample,代碼行數:8,代碼來源:common-rest-provider.ts

示例7: if

 this.events.subscribe('wordpress:savestatus', (state) => {
   console.log(state);
   if (state.state === 'saving') {
     this.loader.present();
     console.log('saving');
   }
   else if (state.state === 'error') {
     this.loader.dismiss();
     this.createLoader();
     this.toastCtrl.create({ message: 'Error Saving Report', duration: 3000 }).present();
   }
   else if (state.state === 'finished') {
     this.loader.dismiss();
     this.createLoader();
     console.log('finished');
   }
 });
開發者ID:qwb0920,項目名稱:wp-rest-api-ionic2,代碼行數:17,代碼來源:report.ts

示例8: dismissLoading

 //noinspection TypeScriptUnresolvedVariable
 dismissLoading(): Promise<any> {
   if(this.loading) {
     return this.loading.dismiss().then(() => this.loading = null);
   } else {
     //noinspection TypeScriptUnresolvedFunction
     return new Promise(func => func());
   }
 }
開發者ID:packowitz,項目名稱:ask-the-people,代碼行數:9,代碼來源:notification.service.ts

示例9:

 (err)=>{
   let alert = Alert.create({
     title : "Couldn't get your info",
     subTitle : "You can't continue right now, Try again later",
     buttons:['Will check it out']
   });
   this.loading.dismiss();
   this.nav.present(alert);
 }
開發者ID:ujjwal996,項目名稱:campChatIonic,代碼行數:9,代碼來源:login.ts


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