ionic ion-tab click not working
Short description of the problem:
I have an project with tabs, but the (click)-event doesn’t work and if I leave the attribute [root] away (not required because I want to show an action sheet), then the app crashes.
What behavior are you expecting?
Click on the tab and see the action sheet appear
<ion-tabs> <ion-tab tabTitle="Tab 1" tabIcon="pulse" (click)="presentActionSheet()"></ion-tab> </ion-tabs> presentActionSheet() { let actionSheet = ActionSheet.create({ title: 'Modify your album', buttons: [{ text: 'Destructive', role: 'destructive', handler: () => { console.log('Destructive clicked'); } }, { text: 'Archive', handler: () => { console.log('Archive clicked'); } }, { text: 'Cancel', role: 'cancel', handler: () => { console.log('Cancel clicked'); } }] }); this.navController.present(actionSheet); }
What Solution are you finding?
<ion-tabs> <ion-tab tabTitle="Tab 1" tabIcon="pulse" (ionSelect)="presentActionSheet()"></ion-tab> </ion-tabs>
Share