离子4点击事件

Ionic 4 Click event

嗨,我开始学习 Ionic 4。目前我在 packages.json 中的版本是

      "@angular/animations": "~7.0.0",
      "@angular/common": "^7.2.2",
      "@angular/core": "^7.2.2",
      "@angular/platform-browser": "^7.2.2",
      "@angular/platform-browser-dynamic": "^7.2.2",
      "@angular/router": "^7.2.2",
      "@ionic-native/core": "^5.0.0",
      "@ionic-native/splash-screen": "^5.0.0",
      "@ionic-native/status-bar": "^5.0.0",
      "@ionic/angular": "^4.0.0"

我正在尝试将按钮用作

<button ion-button (click)="test()">Click Me! </button>

问题是点击事件没有绑定。我在这里错过了什么?

Ionic 4 不再使用 <button> 标签,而是使用 <ion-button>.

<!-- Default -->
<ion-button>Default</ion-button>

看这里:https://beta.ionicframework.com/docs/api/button