In my Ionic framework app, I have a popover that contains two options: share and delete. When the delete option is selected, I want to display a confirmation popup. However, I'm not sure how to implement this.
Should I create a separate controller for the popover? I have successfully implemented a popup coming from an ActionSheet before, but this seems to be a different scenario.
Here is the current controller code:
$ionicPopover.fromTemplateUrl('templates/popover.html', {
scope: $scope
}).then(function(popover) {
$scope.popover = popover;
});
// Triggered on a button click, or some other target
$scope.openPopover = function($event) {
$scope.popover.show($event);
};
And here is the popover template:
<ion-popover-view style="height: 120px">
<ion-content>
<div class="list">
<a class="item">
Share
</a>
<a class="item">
Delete
</a>
</div>
</ion-content>
</ion-popover-view>