Files
ionic-framework/angular/test/test-app/src/app/alert/alert.component.ts
2019-07-06 19:33:34 +02:00

32 lines
671 B
TypeScript

import { Component, NgZone } from '@angular/core';
import { AlertController } from '@ionic/angular';
import { NavComponent } from '../nav/nav.component';
@Component({
selector: 'app-alert',
templateUrl: './alert.component.html',
})
export class AlertComponent {
constructor(
private alertCtrl: AlertController
) { }
async openAlert() {
const alert = await this.alertCtrl.create({
header: 'Hello',
message: 'Some text',
buttons: [
{
role: 'cancel',
text: 'Cancel',
handler: () => {
NgZone.assertInAngularZone();
}
}
]
});
await alert.present();
}
}