I have a bunch of ionic 2 cards which I want to flip on the press of a key (any key, it doesn't matter). The code looks like
<ion-content padding>
<ion-card (click)="setTime(7)" *ngIf="status == 'morning'" (keypress)="eventHandler($event)" style="width:80%">
<img src="https://greatist.com/sites/default/files/Sleeping-Positions-feature.jpg"/>
</ion-card>
</ion-content>
the .ts code
eventHandler(keyCode){
alert('hey vikj');
}
On pressing any key, my event handler is not fired.