title: Angular : disable a text input
body: <p>I have an input text which is disabled by default :</p>
  
  <pre><code> &lt;input type="text" ng-model="city.name" class="form-control"
                                     disabled
                                     name="name"&gt;
  </code></pre>
  
  <p>But i want to enable it when the input country is not null :</p>
  
  <pre><code>   &lt;input type="text" ng-model="country.name" class="form-control"
                                           &gt;
  </code></pre>
  
  <p>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</p>
  
  <pre><code>  // Watch if the country value is not null
              $scope.$watch("country.name", function (value) {
                  if (value !=null) {
                      // enable the city field
                  }
              },true);
  </code></pre>
  
  <p>Thanks</p>