let loadMapDataPromise = function() { indexHttpService.getDataPromise().then(function(res) { $scope.markerArr=res.Data; }); }; loadMapDataPromise(); console.log($scope.markerArr); console.log($scope);為什么在函數(shù)外面打印$scope.markerArr是undefined 呢?但是我在下面試著打印$scope,出來的$scope 上面有markerArr這個數(shù)組????
let 聲明的函數(shù)中請求的數(shù)據(jù)為什么在全局作用域請求不到
繁星點點滴滴
2019-02-28 14:12:04