I am trying to print the input value in ionic popup. But it returns 'undefined' in the console instead of the entered text in the input field. I was trying without $scope as well but didn't work. What might be the problem with it? Below you can see the code I use.
function funcNew() {
var myPopup = $ionicPopup.show({
template: '<input type="text" ng-model="description">',
title: 'Enter Description',
subTitle: '',
scope: $scope,
buttons: [
{
text: 'Cancel'
},
{
text: '<b>Yes</b>',
type: 'button-positive',
onTap: function (e) {
console.log($scope.description);
}
}]
});
}
console.log($scope)that could give you more insight into what is happening