With angularJS, I need populate a select with data coming from a ajax call.
I have a controlller called "TabPacProfissionalController".In this controller I do a ajax call to get json data('profissionais object'). So far so good.
My problem is that I get the json data returning from server, but my select is never populate.
What am I missing here?
My ajax return is:
{"results":[{"nr":"8","nome":"AAAAAAAAAAAA"},
{"nr":"17","nome":"BBBBBBB"},
{"nr":"27","nome":"BBBBBAAAAA"},
,{"nr":"1004","nome":"CCCCCCCCC"}]}
HTML
        <div class="form-group">
            <label for="paciente.texto.sexo" class="col-sm-2 control-label">Profissional:</label>
            <div class="col-sm-10" ng-controller="TabPacProfissionalController as tabProfCtrl">
                <select class="form-control" ng-model="selectedProf" ng-options="nome for (nr,nome) in tabProfCtrl.profissionais">
                  <option value=''>Select an option</option>
                </select>
             </div>
        </div>
JS:
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);
        });
      });


var self = this;and reference toselfinside the http success function