我試圖以ng-hide
爲真的方式設置此<input>
,無論ng-model
是什麼都重置。當ng-hide爲真時清除輸入ng-model AngularJS
<input type="text" class="form-control" ng-model="account.AccountName" ng-hide="account.AccountStatus == 'Terminated'">
所以會有含Active
和Terminated
綁定到ng-model="account.AccountStatus"
的下拉列表。當它是Active
時,字段Account Name將在那裏有文本。我想要做到這一點,當我切換到Terminated
時,該輸入字段被隱藏,並且account.AccountName
被設置爲「」。