0
我有一個默認禁用的文本輸入:角:禁用文本輸入
<input type="text" ng-model="city.name" class="form-control"
disabled
name="name">
但我想啓用它,當輸入國不爲空:
<input type="text" ng-model="country.name" class="form-control"
>
哪有我在角度控制器中這樣做?我開始像這樣 在我的控制器,但我不知道如何啓用它一旦國內值不爲空
// Watch if the country value is not null
$scope.$watch("country.name", function (value) {
if (value !=null) {
// enable the city field
}
},true);
感謝
Omg!最快和有效的答案:)謝謝 – user708683
NP,不要忘記接受+ upvote :) –
完成Mathew Berg :) – user708683