猿问

JavaScript如何获取函数内部变量

success(function(data) {
   angular.forEach(data.response.venues, function(item) {                    
   var pin = {                        latitude: parseFloat(item.location.lat),                        
   longitude: parseFloat(item.location.lng),                        
   title: item.name,                        
   id: item.id
                    }
                    pin.options = {                        
                    icon: $dynamicConstants.getCdnImagesUrl() + query + '.png',                        
                    labelStyle: { 'overflow': 'visible' }
                    };
                    $scope.map.markers.push(pin);
                })
            }).error(function() {

            });

请问如何function(data)外获取到var pin的值?


呼啦一阵风
浏览 447回答 1
1回答
随时随地看视频慕课网APP

相关分类

JavaScript
我要回答