2
Is there any way to filter the record from enter, not at runtime as is customary for Angular?
2
Is there any way to filter the record from enter, not at runtime as is customary for Angular?
1
You can implement a directive:
angular.module('meuApp').directive('ngEnter', function () {
return function (scope, element, attrs) {
element.bind("keydown keypress", function (event) {
if (event.which === 13) {
scope.$apply(function () {
scope.$eval(attrs.ngEnter);
});
event.preventDefault();
}
});
};
});
You can then use the prop ng-enter
in a control:
<input type="text" name="Procura" placeholder="Procura" ng-model="Termos" ng-enter="Procura()">
Browser other questions tagged angularjs
You are not signed in. Login or sign up in order to post.
Thank you very much, helped me a lot. Thank you very much
– Cristian Da Silva