Typeahead AngularJS在点击时没有“选择”

时间:2014-07-12 19:57:09

标签: html angularjs mongodb twitter-bootstrap-3

我正在使用AngularJS + Bootstrap,这是我从服务器获取JSON的代码:

ps:pessoa = person

function TypeaheadCtrl($ scope,$ http){

  $scope.selected = undefined;

$scope.getNomes = function(val) {
    return $http.get('/pessoa/buscarPor', {
      params: {
        nome: val,
        sensor: false
      }
    }).then(function (res){

          pessoas = [];
          angular.forEach(res.data.list, function(item){
              pessoas.push(item.busca_formatada);
              });
    return pessoas;
    })
  };

并在html中:

<input type="text" ng-model="asyncSelected" typeahead="pessoa for pessoa in getNomes($viewValue)" typeahead-loading="loadingLocations" class="form-control">

它会显示结果,但是当我点击没有任何更改或字段填满时

0 个答案:

没有答案