0
如何使用角度js和表單等來顯示錯誤類/消息?如何在angularjs中進行表單驗證和條件標記?
我試過,但它似乎並沒有在所有驗證:
<div class="form-group" ng-class="{'has-error': obj.title.$invalid}">
<label for="name">Name</label>
<input type="text" class="form-control" id="name" ng-model="obj.title" required>
</div>
<div class="alert alert-danger" ng-show="obj.title.$invalid">
You are required to enter a name.
</div>
http://plnkr.co/edit/C6eU4pIS8FTfA59SCShh?p=preview