How to use the @ionic/core.loadingController.create function in @ionic/core

To help you get started, we’ve selected a few @ionic/core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github deckgo / deckdeckgo / studio / src / app / pages / core / app-settings / app-settings.tsx View on Github external
return new Promise(async (resolve) => {
            try {
                const loading: HTMLIonLoadingElement = await loadingController.create({});

                await loading.present();

                const firebaseUser: firebase.User = firebase.auth().currentUser;

                if (firebaseUser) {
                    // We need the user token to access the API, therefore delete it here first
                    await this.apiUserService.delete(this.apiUser.id, this.authUser.token);

                    // Then delete the user
                    await this.userService.delete(this.authUser.uid);

                    // Decks and slides are delete with a cloud function triggered on auth.delete

                    await firebaseUser.delete();
                }
github deckgo / deckdeckgo / studio / src / app / components / core / app-delete-deck-action / app-delete-deck-action.tsx View on Github external
return new Promise(async (resolve) => {
            if (!this.deck || !this.deck.id || this.deck.id === undefined || this.deck.id === '') {
                resolve();
                return;
            }

            const loading: HTMLIonLoadingElement = await loadingController.create({});

            await loading.present();

            await this.deckService.delete(this.deck.id);

            this.deckDeleted.emit(this.deck.id);

            await loading.dismiss();

            resolve();
        });
    }
github jgw96 / web-whiteboard / src / components / app-images / app-images.tsx View on Github external
handler: async (): Promise => {
            const imageBlob = b64toBlob(image.url.replace("data:image/png;base64,", ""), 'image/jpg');

            let provider = (window as any).mgt.Providers.globalProvider;
            if (provider) {
              let graphClient = provider.graph.client;
              console.log(graphClient);

              const loading = await loadingController.create({
                message: "Uploading...",
                showBackdrop: navigator.userAgent.includes('iPad') === false && window.matchMedia("(min-width: 1200px)").matches ? false : true
              });
              await loading.present();

              await sheet.dismiss();

              try {
                const driveItem = await graphClient.api('/me/drive/root/children').middlewareOptions((window as any).mgt.prepScopes('user.read', 'files.readwrite')).post({
                  "name": "webboard",
                  "folder": {}
                });
                console.log(driveItem);

                const fileUpload = await graphClient.api(`/me/drive/items/${driveItem.id}:/${image.name}.jpg:/content`).middlewareOptions((window as any).mgt.prepScopes('user.read', 'files.readwrite')).put(imageBlob);
                console.log(fileUpload);
github jgw96 / web-whiteboard / src / components / app-images / app-images.tsx View on Github external
async refreshImages() {
    const loading = await loadingController.create({
      message: "Loading images from the cloud...",
      showBackdrop: navigator.userAgent.includes('iPad') === false && window.matchMedia("(min-width: 1200px)").matches ? false : true
    });
    await loading.present();

    console.log('trying to get images from the cloud');
    try {
      const data = await getSavedImages();
      console.log(data);

      this.images = data.images

      await loading.dismiss();

      await set('images', this.images);
    }
github jgw96 / web-whiteboard / src / components / color-modal / color-modal.tsx View on Github external
async grabColor() {
    const loading = await loadingCtrl.create({
      message: "Analyzing...",
      showBackdrop: navigator.userAgent.includes('iPad') === false && window.matchMedia("(min-width: 1200px)").matches ? false : true
    });
    await loading.present();

    const blobPhoto = await this.capture.takePhoto();

    let reader = new FileReader();
    reader.readAsArrayBuffer(blobPhoto);
    reader.onloadend = async () => {
      const aiToken = localStorage.getItem('ai');
      if (aiToken) {
        const response = await fetch(`https://westus2.api.cognitive.microsoft.com/vision/v2.0/analyze?visualFeatures=Color`, {
          headers: {
            "Ocp-Apim-Subscription-Key": "d930861b5bba49e5939b843f9c4e5846",
            "Content-Type": "application/octet-stream"