How to use the @ionic/core.modalController.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 jgw96 / web-whiteboard / src / components / app-home / app-home.tsx View on Github external
async allImages() {
    this.savedImage = null;

    const modal = await modalCtrl.create({
      component: 'app-images',
      cssClass: 'imagesModal',
      showBackdrop: navigator.userAgent.includes('iPad') === false && window.matchMedia("(min-width: 1200px)").matches ? false : true
    });
    await modal.present();

    const { data } = await modal.onDidDismiss();
    console.log(data);

    if (data && data.url) {
      console.log(data);
      if (data.name) {
        this.currentFileName = data.name;
      }

      this.savedImage = data.url;
github deckgo / deckdeckgo / studio / src / app / helpers / editor / image.helper.tsx View on Github external
private async openModal(selectedElement: HTMLElement, slide: boolean, deck: boolean, componentTag: string, action?: EditAction) {
        const modal: HTMLIonModalElement = await modalController.create({
            component: componentTag
        });

        modal.onDidDismiss().then(async (detail: OverlayEventDetail) => {
            if (detail && detail.data && selectedElement) {
                if (action === EditAction.OPEN_CUSTOM_LOGO) {
                    await this.updateSlideAttribute(selectedElement, detail.data, 'img-src');
                } else if (action === EditAction.OPEN_DATA) {
                    await this.updateSlideAttribute(selectedElement, detail.data, 'src');
                } else {
                    await this.appendImage(selectedElement, slide, deck, detail.data);
                }
            }

            this.blockSlide.emit(false);
        });
github deckgo / deckdeckgo / studio / src / app / components / editor / app-editor-toolbar / app-editor-toolbar.tsx View on Github external
private async openNotes() {
        const modal: HTMLIonModalElement = await modalController.create({
            component: 'app-notes',
            componentProps: {
                selectedElement: this.selectedElement
            }
        });

        modal.onDidDismiss().then(async (detail: OverlayEventDetail) => {
            if (detail && detail.data && this.selectedElement) {
                this.notesDidChange.emit(this.selectedElement);
            }

            this.blockSlide.emit(false);
        });

        this.blockSlide.emit(true);
github jgw96 / web-whiteboard / src / components / pwa-install / pwa-install.tsx View on Github external
async install() {
    const modal = await modalCtrl.create({
      component: 'install-modal',
      cssClass: 'installModal',
      componentProps: {
        installEvent: this.deferredPrompt
      }
    });
    await modal.present();
  }
github deckgo / deckdeckgo / studio / src / app / components / core / app-delete-deck-action / app-delete-deck-action.tsx View on Github external
private async presentConfirmDelete($event: UIEvent) {
        $event.stopPropagation();

        if (!this.deck || !this.deck.data) {
            return;
        }

        const modal: HTMLIonModalElement = await modalController.create({
            component: 'app-deck-delete',
            componentProps: {
                deckName: this.deck.data.name,
                published: this.deck.data.meta && this.deck.data.meta.published
            }
        });

        modal.onDidDismiss().then(async (detail: OverlayEventDetail) => {
            if (detail && detail.data) {
                await this.deleteDeck();
            }
        });

        await modal.present();
    }
github deckgo / deckdeckgo / studio / src / app / pages / core / app-settings / app-settings.tsx View on Github external
private async presentConfirmDelete() {
        const modal: HTMLIonModalElement = await modalController.create({
            component: 'app-user-delete',
            componentProps: {
                username: this.apiUser.username
            }
        });

        modal.onDidDismiss().then(async (detail: OverlayEventDetail) => {
            if (detail && detail.data) {
                await this.deleteUser();
            }
        });

        await modal.present();
    }
github deckgo / deckdeckgo / remote / src / app / pages / app-remote / app-remote.tsx View on Github external
private async openConnectModal() {
        const modal: HTMLIonModalElement = await modalController.create({
            component: 'app-remote-connect'
        });

        modal.onDidDismiss().then(async (detail: OverlayEventDetail) => {
            if (detail && detail.data) {
                await this.connect();
            } else {
                await this.disconnect();
            }
        });

        await modal.present();
    }
github deckgo / deckdeckgo / studio / src / app / components / editor / actions / app-editor-actions / app-editor-actions.tsx View on Github external
private async openChart(attributes: SlideAttributes) {
        const modal: HTMLIonModalElement = await modalController.create({
            component: 'app-custom-data'
        });

        modal.onDidDismiss().then(async (detail: OverlayEventDetail) => {
            if (detail && detail.data) {
                await this.addSlideChart(detail.data, attributes);
            }
        });

        await modal.present();
    }
github deckgo / deckdeckgo / remote / src / app / pages / app-remote / app-remote.tsx View on Github external
private async openSlidePicker() {
        const modal: HTMLIonModalElement = await modalController.create({
            component: 'app-remote-slide-picker',
            componentProps: {
                slides: this.slides
            }
        });

        modal.onDidDismiss().then(async (detail: OverlayEventDetail) => {
            if (detail.data >= 0) {
                await this.slidePickerTo(detail.data);
            }
        });

        await modal.present();
    }