我想實現一個簡單的引導程序typeahead響應獲取通過http調用。我收到了完美的響應,但它似乎從服務調用的最新值是沒有被綁定到從哪個typeahead正在讀取的範圍變量。無法綁定來自http調用的最新數據提前
$ scope.onChangeCallBack =功能(viewValue){
var program = $scope.program.name;
var occupancyType = $scope.occupancyType.name;
var isStorage = $scope.isBuildingStorage;
var isFranchise = $scope.isFranchise;
var isLeased = $scope.isLeased;
var isBarBuilding=$scope.isBarBuilding;
console.log("program:"+program+"//occupancyType:"+occupancyType+"//isStorage:"+isStorage+"//isFranchise:"+isFranchise+"//+isBarBuilding"+isBarBuilding+"//viewValue"+viewValue);
var param =
{
searchString: viewValue,
filterCriteria: {
isBar: true/*isBarBuilding*/,
isFranchise: false/*isFranchise*/,
isMercantile: true/*isLeased*/,
program: program,
occupancyType:"tennat"
}
}
var promise = AEBusinessOwnerService.getBuildingClassification(param);
promise.then(function(data) {
console.log(JSON.stringify(data.results));
$sccope.classificationTypeAhead = data.results;
});
};
後4個字在鍵入該得到顯示的搜索結果只鍵入5個字符後是可見的。我不知道有什麼缺失。
你還沒有修復你的代碼中的錯字嗎?在承諾中您有$ sccope.classificationTypeAhead。 $範圍拼寫錯誤。 – DanielC
是的我修正了它。Ranjan –