Hi, I am currently working for android application. I am using ionic pop over which displays my menu like below
On select of any item on pop up my popover should close automatically. Currently I need to tap some where to close the pop up. Can some one help me how to do this? I really need this.
I followed exactly the same what you suggested. It is working fine on the simulator as well as plunk. But it is not working on my device (Samsung S5) any idea?
Here is plunk i created. Click on grid icon on home screen. You should see popover.
because of the demo works fine in plunk, and I have not get the real S5 device on hand, so it’s hard to test and reproduce the issue. but I notice that you’ve missed the cordova.js in the index.html. this file is required for building the real APP.
as ionic’s guide says, you can add this file in index.html’s header like this:
<!-- Needed for Cordova/PhoneGap (will be a 404 during development) -->
<script src="cordova.js"></script>
Thanks for your reply.
I created a sample application with same and it is working as expected even in device. It looks like some thing went wrong in my project structure. We are over-riding couple of things in css. and also using gulp to generate a single CSS file. Looks like I need to verify those.
@beetaa, yes. my mistake it was typo error. I fixed now. But I am still having issue when trying to load second popover. App is freezing at that time. I am trying to do a sample project.
My question is, is it okay to load two popovers on the same screen?
Hello
I have also need two popovers on different pages.
I have faced some problem with popover. when open propover and any Item selected In popover and located another page through popover. it’s not close automatically on other page when it located .
how to used two popover …?
how to close automatically close when any other page located ?
Hi I’m leaving answer in case someone else needs, I solved it like this
<li class="item" ng-repeat="city in cities" ng-click="citiesClick(city.label)">
then inside my controller is:
/**
* Loads the ionicPopover with content from doctors.html/popoverCities.html
* then passes the popover instance to $scope in the controller
*/
$ionicPopover.fromTemplateUrl('popoverCities.html', {
scope: $scope
}).then(function (popover) {
$scope.citiesPopover = popover;
});
//now notice in citiesClick after all is done closes the citiesPopover.hide()
$scope.citiesClick = function (city) {
$scope.city = city;
$scope.citiesLabel = $scope.city.name;
$scope.cityId = $scope.city.label;
$scope.citiesPopover.hide(); //THIS IS THE IMPORTANT PART
}
Having the same problem, the popup does not close when I switch view. Tried all the examples above but did not work. I managed to get it to work by using a function in the navigation while also going to a new view. Might or might not be the ideal way but it works. cheers.
//open the popup
//add the close function to one of the popup navigation links Account