ng-class="{'error': signUpForm.username.$invalid && signUpForm.user}“ 不起作用啊
<form name="signUpForm" ng-submit="submitForm()">
<div class="form-group">
<label>用户名:</label>
<input name="username"
ng-model="username"
ng-class="{'error': signUpForm.username.$invalid && signUpForm.username.$touched }"
ng-minlength="3"
required
class="form-control input">
</div>
<div ng-if="signUpForm.username.$invalid && signUpForm.username.$touched">您的输入有误请检查</div>
</form>