I use Inline Modals in my code, and I want to use isOpen property to control the opening and closing of the model,
since I use buttons to control the opening and closing, I need to “know” when the model closes, to do this and according to the documentation:
Developers need to listen for the
ionModalDidDismiss
ordidDismiss
events and set the reactive variable tofalse
themselves.
All the examples on the Internet that I have seen on the subject, explained to cases that use Controller Modals and not Inline Modals,
It should be noted that a solution by using trigger property instead of isOpen will not help in my specific case, as I need two buttons to control the opening and closing of the model, and a trigger is only useful for one button.
Here is the code:
<ion-content>
<ion-button class="toggleDisplayModal1"></ion-button>
<ion-button class="toggleDisplayModal2"></ion-button>
</ion-content>
<ion-footer>
<ion-modal class="ionModal" [isOpen]="isModelOpen" >
<ng-template >
<ion-content >
<my-content/>
</ion-content>
</ng-template>
</ion-modal>
</ion-footer>
I’m new to ionic and angular, and I do not understand how I do it, so I would be happy if something would explain to me, thanks!