Is there any way to do the registry filter from the enter, not at runtime as is usual for the Angular?
Is there any way to do the registry filter from the enter, not at runtime as is usual for the Angular?
You can implement a policy:
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 ng-enter
property in a control:
<input type="text" name="Procura" placeholder="Procura" ng-model="Termos" ng-enter="Procura()">