1

Is there a way to filter through inputs in Angular? I'd Imagine

var input = e.$filter(/a-zA-Z/);
user2167582
  • 5,986
  • 13
  • 64
  • 121

1 Answers1

1

I'm not sure to understand your question, but you can force a pattern on an input with the ngPattern directive.

<form name="theForm" novalidate>
   <input type="text" ng-model="foo" ng-pattern="/a-zA-Z/" required/>
   <button ng-click="update()" ng-disabled="theForm.$invalid">SAVE</button>
</form>
Galdo
  • 945
  • 6
  • 12
  • Thanks, I didn't know ng-pattern does that, but ng-pattern doesn't filter, it only validates. is there a filter that can say ng-filter ="/a-zA-Z/" and only take input of alphabets – user2167582 Mar 22 '13 at 21:24