필드 유효성 검사가 포함 된 간단한 페이지가 있습니다. employee.html
필드의 유효성을 검사하지만 동일한 코드를 추가하고 ng- 유효성 검사가유효 숫자가 포함 된 경우 유효성 검사가 작동하지 않습니다.
without ng-include
유효성 검사를 작동하지 않는 포함하여 작동합니다
DAS :
<form name="form" class="form-horizontal" ng-validate="create(data)" novalidate>
<div class="row">
<div class="col-xs-6">
<div class="form-group">
<label for="" class="col-xs-6 control-label">First Name:</label>
<div class="col-xs-6">
<input name="first_name" type="text" class="form-control" ng-model="data.first_name" placeholder="First name" ng-required="true">
<div class="alert alert-danger" ng-show="form.$submitted && form.first_name.$error.required">Enter first name.</div>
</div>
</div>
</div>
</div>
</form>
with ng-include
유효성을하지 작업을 수행 hboard.html
<div class="container">
....................
..................
<ng-include src="employee.html"></ng-include>
</div>
내 질문은 : 어떻게 유효성 검사가 NG-포함 내에서 작동 할 수 있습니까?
'ng-include'는 자체 범위를 생성한다는 사실과 관련이 있다고 생각합니다.하지만 더 많은 컨텍스트가 필요합니다 (바이올린은 훌륭합니다). – Rasalom
유효성 검사가 작동하지 않는 유일한 방법입니까? –
네 유효성 검사가 작동하지 않는 유일한 것 –