let loadMapDataPromise = function() {
indexHttpService.getDataPromise().then(function(res) {
$scope.markerArr=res.Data;
});
};
loadMapDataPromise();
console.log($scope.markerArr);
console.log($scope);
为什么在函数外面打印$scope.markerArr是undefined 呢?
但是我在下面试着打印$scope,出来的$scope 上面有markerArr这个数组啊??
是我看走眼了。。。
如果你数据少的话 你可以改成同步
async:true