/
githubmirror
/
ionic
Обзор
Документация
Войти
/
githubmirror
/
ionic
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
packages/angular/test/base/src/app/lazy/alert/alert.component.ts
39 строк
785 B
Brandy Carney
test(angular): add ng19 test app (#30041)
04 дек 2024, 20:02
Не верифицирован
04 дек 2024, 20:02
e101f2e
Код
Авторство
О чём код?
import { Component, NgZone } from '@angular/core'; import { AlertController } from '@ionic/angular'; @Component({ selector: 'app-alert', templateUrl: './alert.component.html', standalone: false }) export class AlertComponent { changes = 0; constructor( private alertCtrl: AlertController ) { } counter() { this.changes++; return Math.floor(this.changes / 2); } async openAlert() { const alert = await this.alertCtrl.create({ header: 'Hello', message: 'Some text', buttons: [ { role: 'cancel', text: 'Cancel', handler: () => { console.log(NgZone.isInAngularZone()); NgZone.assertInAngularZone(); } } ] }); await alert.present(); } }