2016-06-09 2 views
1

나는 xxx-xxx-xxxx 형식에 숫자를 마스크 노력과 전화 번호가 0을 제외한 모든 자리에서 시작 있는지 확인하려고 1UI-마스크와 전화 번호

<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> 
작동하지 ngpattern

숫자는 항상 유효하지 않은 숫자입니다. editForm.homePhone을 인쇄하려고했습니다.

나는 stackoverflow의 모든 게시물을 점검했습니다. 그들을 시험했지만, 가지 마라. 무엇이 잘못 되었습니까? 내가 UI-utils.js을 사용하고

- v0.1.1을 UI-마스크는

답변