I have a use case where I'd like to open an Ionic Modal by clicking an Ion Tab.
Our app has 4 fixed ion-tabs
. One of the tabs currently goes to a comment form but it would be better suited as a modal (so the user can quickly complete the form and go back to what they were doing).
Modals are normally attached to a button. I've attempted to open the modal using ng-click
on the tab, similar to this demo but with no luck.
Is it possible to use an ion-tab
to open a ion-modal
?
You can add a "fake" tab to your tabs:
As you can see the last one is empty:
We you click to the tab (ng-click) it calls a method
openMyModal
.Since I haven't defined a controller for that tab I am going to use the controller for the abstract tabs:
and this would be the controller TabsController:
If you want to see it in action check this plunker.