javascript - Angular ng-message is not shown up when adding a ng-pattern -
i added ng-pattern="/^[0-9]{1,7}$/" input field (type=number) validate numbers without 'e' letter.i using angular material.it validating , showing red color in input validation message not showing up.it shown kind of similar value '3223233e3'
this happens when supply number , single e
:
this happens when supply many e
's:
<input type="number" id="txtand" ng-model="txtand" ng-pattern="/^[0-9]{1,25}$/" name="andocc" required /> <div ng-messages="three.andocc.$error"> <div ng-message="required">please supply value</div> <div ng-message="pattern">please supply valid value</div> </div>
in pen @edric,
try code
<div ng-messages="three.andocc.$error"> <div ng-message="required">please supply value</div> <div ng-message="number">please supply valid value</div> </div>
Comments
Post a Comment