为什么此离子警报代码在使用角度时不起作用

时间:2019-11-01 12:21:05

标签: angular ionic-framework ionic4

async presentAlert() {
    const alert = await this.alertController.create({
      header: 'Alert',
      subHeader: 'Subtitle',
      message: 'This is an alert message.',
      buttons: ['OK'],
    });

    await alert.present();
    let result = await alert.onDidDismiss();
    console.log(result);
  }

我的html是

  <div class="about-button">
                <ion-button (click)="presentAlert()">About</ion-button>
              </div>

这将如何工作? 单击按钮没有任何反应,这是行不通的。 我的离子版本是5.4.5 并尝试了离子4

2 个答案:

答案 0 :(得分:0)

我发现了这一点,仅使用await一次。 您可以在警报关闭处有一个按钮来处理数据。

for item in a:
    x, y = pyautogui.center(item)

答案 1 :(得分:0)

实际上,所有内容都是正确的。我的app.html中只有2个app-root。这无法使其显示。