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}" />
<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}" />
0 comments