Hello! Could someone help me how to make a popover menu like this:
Hi, have you tried using the Ionic popover?
Cheers,
Gustavo.
Hi Gustavo thanks for reply.I tried this but when I click display another page in small dimensions.I just want a button.
oh
and what happens if you add an ionic button in that page?
I tried adding a button but nothing happens,the same.
You can use this reference to show a popOver from a menu button
I already seen but didn’t helped so much.
Try to console.log anything when you click on the button, to know if it listens to the event or not
Can you copy your HTML and TS regarding this function and paste it here so i can tell you what exactly is wrong, ^^
HTML
<ion-header>
<ion-navbar color="secondary">
<ion-title>Odl Servizi</ion-title>
<ion-buttons end>
<button ion-button icon-only (click)="presentPopover($event)">
<ion-icon name="more"></ion-icon>
</button>
<button ion-button clear color="secondary" (click)="home()">LOGOUT</button>
</ion-buttons>
</ion-navbar>
</ion-header>
TS
presentPopover(myEvent) {
let popover = this.popoverCtrl.create(PopoverPage);
popover.present({
ev: myEvent
});
change
presentPopover(myEvent) into presentPopover(myEvent: MouseEvent)
try now and tell me
I tried!
Nothing happened
did you try to console.log anything to make sure the function is working?
Yes!!
Nothing again!!
so nothing is logging to the console or its logging but the popover is not showing?
popover is not showing
Ok,
1- Make sure of the page name you’re trying to open
2- make sure you are importing PopoverController from ‘ionic-angular’
3- make sure you added PopoverController to the constructor as public and ur calling it right
Everything is OK !!!
Ok, i’m out of options now, why don’t you create a stackblitz project and put your code inside it and send me the link, i will go check it myself and test it
OK! Thank you very much for advice!