$ionicPopup: using select does not

I am trying to make a quick country selector popup to show up after a credit card is scanned. The first thing I’m seeing is that the selected attribute is not working, so the dropdown is blank by default. Once I select the dropdown and pick the country, hit done and get to the on-tap handler, the ng-model variable has not been updated. The code in my controller:


var getCountry=function(){
var ctryPopup = $ionicPopup.show({
templateUrl: ‘./templates/countryPopup.html’,
title: ‘Select Country’,
scope: $scope,
buttons: [
text: ‘Done’,
type: ‘button-positive’,
onTap: function(e) {
if (!$scope.data.country) {
//don’t allow the user to close unless we get a country
} else {
return true;
return ctryPopup
return true;



It seems to be a timing issue, like the ng-model variable has not been bound yet, or something. In the meantime, I’m having to make the user enter the country abbreviation manually in an $ionicPopup.prompt.