ng-class中是用name來(lái)尋找判斷的屬性么?
如:<form name="Form" ng-submit="submitForm" ng-controller="mycontroller">
?? ??? ?<div class="form-group">
?? ??? ??? ?<label>用戶(hù)名:</label>
?? ??? ??? ?<input ng-class="{'error': Form.username.$invalid && Form.username.$touched}"
?? ??? ??? ??? ??? class="form-control"
?? ??? ??? ??? ??? name="username"
?? ??? ??? ??? ??? ng-model="username"
?? ??? ??? ??? ??? ng-minlength = "4"
?? ??? ??? ??? ??? required
?? ??? ??? ??? ??? >
?? ??? ??? ?<div ng-if="Form.username.$invalid && Form.username.$touched">您輸入的信息有誤請(qǐng)檢查</div>
?? ??? ?</div>
?? ?</form>
2016-07-07
是通過(guò)name名來(lái)尋找元素,獲取里面的值,然后通過(guò)服務(wù)進(jìn)行判斷