1import { Component } from '@angular/core';
2import { ModalController } from '@ionic/angular';
3import { ModalPage } from '../modal/modal.page';
4
5@Component({
6 selector: 'modal-example',
7 templateUrl: 'modal-example.html',
8 styleUrls: ['./modal-example.css']
9})
10export class ModalExample {
11 constructor(public modalController: ModalController) {
12
13 }
14
15 async presentModal() {
16 const modal = await this.modalController.create({
17 component: ModalPage,
18 cssClass: 'my-custom-class'
19 });
20 return await modal.present();
21 }
22}
1import { Component } from '@angular/core';
2import { ModalController } from '@ionic/angular';
3import { ModalPage } from '../modal/modal.page';
4
5@Component({
6 selector: 'modal-example',
7 templateUrl: 'modal-example.html',
8 styleUrls: ['./modal-example.css']
9})
10export class ModalExample {
11 constructor(public modalController: ModalController) {
12
13 }
14
15 async presentModal() {
16 const modal = await this.modalController.create({
17 component: ModalPage
18 });
19 return await modal.present();
20 }
21}