2016-06-17 3 views
0

ng-file-upload 지시문을 사용하여 여러 mp3 파일을 업로드하고 잘못된 파일 확장에 대한 유효성 검사를 적용하려고합니다.ng-file-upload 지시어가 ng-messages와 작동하지 않습니다.

 <div class="form-group" show-errors> 
     <label for="myfiles" class="control-label">{{constant.SELECT_FILE_OR_MULTIPLE_FILES}}:</label> 
     <input 
      type="file" 
      ngf-select 
      ng-model="series.myfiles" 
      name="myfiles" 
      id="myfiles" 
      ngf-max-size="100MB" 
      ngf-validate="{ pattern: '.mp3' }" 
      multiple 

      /> 
     <div ng-messages="form.talkForm.myfiles.$error" role="alert"> 
      <p class="help-block error-text" ng-message="ngf-validate">{{constant.UPLOAD_TALK_ERROR}}</p> 
     </div> 
    </div> 
+0

인쇄가 그래서

는 여기은 패턴 일치이다. 그것은 아마 패턴 (소스에서 빠른 체크 후) – Walfrat

+0

네 correct.its는 지금 일하고있다. –

+0

당신은'ng-messages = "form.talkForm.myfiles를 사용할 수있다. $ errorMessage"' – danial

답변

0

으로는 코멘트 말했다 : 대답은 $ 오류가 발생하는 필드의 이름이 ngf-validate 아니라 검증의 종류의 따라 달라이었다. 오류의 이름은 $ 오류의 값이,이 오류의 이름은 NGF - 유효성 검사를하지 않는 것이 가능하다 pattern