我在 Angular BootStrap 指令中有以下内容: Editable 设置为 false,但我不知道如何获取 $invalid 值。它始终显示为有效。我正在将 Angular-bootstrap .11 与 Angular 1.3 一起使用...似乎模型永远不会更新,因此 $invalid 变为真...
<div class="form-group" ng-class="{ 'has-error':myForm.accountName.$invalid && myForm.accountName.$dirty }">
<form name="myForm">
...
<label>Seller: {{currentLot.sellerCode}}</label>
<input type="text" name="accountName" placeholder="" class="form-control" ng-model="currentLot.accountName"
typeahead="item.sellerCode + ' ' + item.name for item in searchGeneric('accounts',$viewValue)"
typeahead-loading="loadingAccountsSellerCode" typeahead-on-select="accountSelected($item)"
typeahead-wait-ms="2" typeahead-min-length="2" typeahead-editable="false"
typeahead-append-to-body="false" >
<div class="warning" ng-show="!myForm.accountName.$invalid && lotForm.myForm.$dirty">
<i class="icon-warning-sign"></i> Values must exist in the list...
</div>
<i ng-show="loadingAccountsSellerCode" class="glyphicon glyphicon-refresh"></i>
...