title: How hide a drop-down list when the model is empty in angularjs?
body: <p>I need to hide a drop-down list when the model is empty and to show it when there are values in the model.</p>
  
  <ol>
  <li><p>I have a service to get the values.</p>
  
  <pre>
  angular.module('myApp.services', ['ngResource'])
      .factory('OptionsSelect', ['$resource',
          function ($resource) {
              return $resource('http://myapi/miapp/optionselect/1', {}, {
                  query: {
                      method: 'GET',
                      params: { id: '1' },
                      isArray: false
                  }
              });
          }
      ])
  </pre></li>
  <li><p>The possible result is:</p>
  
  <pre>
  {"1":"red","5":"blue","34":"blue"}
  </pre></li>
  </ol>
  
  <p>or</p>
  
  <pre><code>&lt;pre&gt;
  {}
  &lt;/pre&gt;
  </code></pre>
  
  <ol>
  <li><p>In the controller:</p>
  
  <pre>
  $scope.optionsSelect = OptionsSelect.query();
  </pre></li>
  <li><p>The view is:</p>
  
  <pre>
   &lt;div class="form-group" ng-hide="isHide()">
      &lt;select class="form-control" ng-options="key as value for (key, value) in optionsSelect">
   &lt;/div>
  </pre>
  
  <p>You can view the code in jsfiddle: <a href="http://jsfiddle.net/finsi/LMJXC/38/" rel="nofollow">http://jsfiddle.net/finsi/LMJXC/38/</a></p></li>
  </ol>