嗨,我开始学习Ionic4。目前,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>
问题在于click事件未绑定。我在这里想念什么?
答案 0 :(得分:3)
Ionic 4不再使用<button>
标签,而是使用<ion-button>
。
<!-- Default -->
<ion-button>Default</ion-button>