error
为什么那个.error和.red方法都没有被调用到,检查了好几遍还是没找到问题所在!!!!!
样式
<style>
.red{
background: #a30;
}
.error{
border: 1px solid #a10;
}
</style>
表单:
<form name="signUpForm" action="" ng-submit="submitForm()">
<div class="form-group">
<label>用户名:</label>
<input class="form-control"
ng-model="username"
name="username"
ng-class="{ 'error': signUpForm.username.$invalid && $touched}"
class="form-control"
ng-minlength = "4"
maxlength="10"
required
>
</div>
</form>