I have following code:
$ionicPopover.fromTemplateUrl('templates/popover_available_sounds.html', {
scope: $scope,
}).then(function(popover) {
$scope.popover = popover;
});
// Display Popover
$scope.openPopover = function($event) {
$scope.popover.show($event);
};
$scope.closePopover = function() {
$scope.popover.hide();
};
Which is called from view using:
<button ng-click="openPopover($event)"
class="button button-icon icon ion-plus-circled"></button>
So i'm not able to pass URL of the template as param.
How can i do it please?
Thanks for any advice.
I solved it using following code modification:
// Display Popover
$scope.openPopover = function($event, templateName) {
// Init popover on load
$ionicPopover.fromTemplateUrl('templates/'+templateName, {
scope: $scope,
}).then(function(popover) {
$scope.popover = popover;
$scope.popover.show($event);
});
};
$scope.closePopover = function() {
$scope.popover.hide();
};
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With