我已经实施了大量时间的uib-typeahead,但我无能为力,为什么它不能正常工作
我想在uib-typeahead中获取项目名称 我的代码就像这样
$scope.suggestTestbySpeciality = function( texts , sp_id) {
var spe_id = sp_id.speciality_id;
$http.post('/youclikc/data/searchTest?speciality_id='+spe_id+'&searchtext='+texts)
.then(function(response) {
return response.data.testrecords.rows;
});
};
功能的Console.log就像这样
Angular就像:
<div class="col-md-3 col-sm-3 col-xs-12 form-group has-feedback">
<input type="text" uib-typeahead="itemz.test_name as itemz.test_name for itemz in suggestTestbySpeciality($viewValue, data1.template_name) | limitTo:8"
ng-model="templateVo.test_name" placeholder ="Template Test Name" class="form-control" ></input>
</div>