Unable to access ng-model in $ionicPopup template.
$scope.dashboard.addMoreModes = function() {
$scope.data = {};
// An elaborate, custom popup
var myPopup = $ionicPopup.show({
template: '<ion-radio ng-model="data.modes" ng-value="item.value" ng-repeat="item in dashboard.paymentModes">{{item}}</ion-radio>',
title: 'Add Payment Modes',
subTitle: 'Select Mode',
scope: $scope,
buttons: [{
text: 'Cancel'
},
{
text: '<b>Add</b>',
type: 'button-positive',
onTap: function(e) {
console.log($scope.data.modes);
}
}
]
});
myPopup.then(function(res) {
console.log('Tapped!', res);
});
};
In the log, data.modes is undefined. How do I access it?