I have an input text which is disabled by default :
<input type="text" ng-model="city.name" class="form-control"
disabled
name="name">
But i want to enable it when the input country is not null :
<input type="text" ng-model="country.name" class="form-control"
>
How can i do this in the angular controller ? i start with something like this in my controller but i dont know how to enable it once the country value is not null
// Watch if the country value is not null
$scope.$watch("country.name", function (value) {
if (value !=null) {
// enable the city field
}
},true);
Thanks