I am trying to mask a number in format xxx-xxx-xxxx and trying to make sure that the the phone number starts from any digit except 0 and 1
<div class="form-group" data-ng-class="{ 'error' : editForm.homePhone.$invalid && editForm.$dirty }">
<label class="label" for="homePhone">Home Phone</label>
<input name="homePhone"
data-ng-model="edit.HomePhoneNumber"
required
ng-pattern="/^[2-9]{1}[0-9]{2}-[0-9]{3}-[0-9]{4}$/"
ui-mask="999-999-9999" ui-mask-placeholder />
<span>{{editForm.homePhone}}</span>
<span class="error-message field-validation" data-ng-show="editForm.homePhone.$invalid && editForm.homePhone.$dirty">
Phone number must be in the format xxx-xxx-xxxx
</span>
</div>
It always says number as invalid. I tried to print editForm.homePhone
I did check all posts on stackoverflow. Tried them, but no go. Not sure what is incorrect?
I am using ui-utils.js - v0.1.1 for ui-mask
The problem seems to be ui-utils.js v0.1.1
I included ui-mask directly and its working correctly: http://codepen.io/emed/pen/GqqmKW
(tested with angular 1.5.5 and ui-mask 1.8.5)