input not showing invalid model values

3:52 PM

The bug can be easily illustrated using the following example code :

<div ng-init="letters='1'">
letters = {{'' + letters}}
<input type="text" ng-model="letters" ng-pattern="/^[a-zA-Z]*$/" />
</div>

for resolve the error just user ng-model-options="{ allowInvalid: true }"  like :

<input type="text" ng-model="letters" ng-pattern="/^[a-zA-Z]*$/" ng-model-options="{allowInvalid: true}" />

You Might Also Like

0 comments