Get toggle in popover with default dismiss


#1

Hi,
I want to add a popover with a toggle button, but I can’t get value from toggle when bakcdrop is clicked.

I succeed when I add function to dismiss when toggling but I don’t want this feature:
<ion-toggle [(ngModel)]=“option” (click)=“toggleOption()”>

toggleOption() {
this.viewCtrl.dismiss(this.option);
}

popover.onDidDismiss(option => {
  this.option = option;
});

I want not to call to dismiss() when I toggle, because I want to see change in realtime.


#2

Instead of using dismiss function I did it with Events.
I read Pass data back on popover backdrop dismiss and that wat I need, so it works.