Ich habe ein Popup in ionischen und haben ein Textfeld und eine Schaltfläche drin. Ich möchte die Eingabetaste drücken, um zu arbeiten und das Popup zu schließen. Ich frage mich, wie Sie diese Aktion in diesem Popup ausführen können.Drücken Enter zum Einreichen in Ionic Popup mit AngularJs
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
})
}
}
]
});
Mögliches Duplikat von [Formular beim Drücken der Eingabetaste mit AngularJS senden] (http://StackOverflow.com/questions/15417125/submit-form-on-pressing-enter-with-angularjs) – Pengyy