Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Angular で入力をフィルタリングする方法はありますか? 私は想像するだろう
var input = e.$filter(/a-zA-Z/);
あなたの質問を理解できるかどうかはわかりませんが、ngPattern ディレクティブを使用して入力にパターンを強制できます。
<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>