title: Populate a select with ajax with ng-options using AngularJs
body: <p>With angularJS, I need populate a select with data coming from a ajax call.</p>
  
  <p>I have a controlller called "TabPacProfissionalController".In this controller I do a ajax call to get json data('profissionais object').
  So far so good.</p>
  
  <p>My problem is that I get the json data returning from server, but my select is never populate.</p>
  
  <p>What am I missing here?</p>
  
  <p>My ajax return is:</p>
  
  <pre><code>{"results":[{"nr":"8","nome":"AAAAAAAAAAAA"},
  {"nr":"17","nome":"BBBBBBB"},
  {"nr":"27","nome":"BBBBBAAAAA"},
  ,{"nr":"1004","nome":"CCCCCCCCC"}]}
  </code></pre>
  
  <p>HTML</p>
  
  <pre><code>        &lt;div class="form-group"&gt;
              &lt;label for="paciente.texto.sexo" class="col-sm-2 control-label"&gt;Profissional:&lt;/label&gt;
              &lt;div class="col-sm-10" ng-controller="TabPacProfissionalController as tabProfCtrl"&gt;
                  &lt;select class="form-control" ng-model="selectedProf" ng-options="nome for (nr,nome) in tabProfCtrl.profissionais"&gt;
                    &lt;option value=''&gt;Select an option&lt;/option&gt;
                  &lt;/select&gt;
               &lt;/div&gt;
          &lt;/div&gt;
  </code></pre>
  
  <p>JS:</p>
  
  <pre><code>app.controller('TabPacProfissionalController', function($http) {
          this.profissionais = {};
          $http.get('/getStaff?tipoProf=1').then(function(response){
                    this.profissionais=response.data.results;
                    console.log(this.profissionais.toString());
          },function(error){
            console.log(error);
          });
        });
  </code></pre>