I have a popup in ionic and have one textfield and one button in it. I want to press enter and want button to work and close the popup. Im wondering how to perform this action within this popup below.
var myPopup = $ionicPopup.show({
            template: '<input type = "text" ng-model = "data.model"><br> '
            , title: 'Name'
            , scope: $scope
            , buttons: [
                {
                    text: 'Cancel'
                }, {
                    text: '<b>Search</b>'
                    , type: 'button-positive'
                    , onTap: function (e) {
                        $ionicLoading.show();
                        $http.get(HTTPService.getHttpText() + 'Persons/' + $scope.data.model).then(function (resp) {
                            console.log('Success', resp);
                            $ionicLoading.hide();
                        }, function (err) {
                            $ionicLoading.hide();
                            console.error('ERR', err);
                            // err.status will contain the status code
                        })
                    }
                    }
                ]
        });
 
     
    