如何将.success的返回数据放入另一个对象?

时间:2015-03-27 19:00:15

标签: angularjs

我试图在.success中获取返回数据。 所以我试过了..

.controller('main', function($scope,$http){
    $http({
    method: 'JSONP',
    url: 'someURL'})
    .success(function(data){
        $scope.responseData = data;
    });
    $scope.anotherObj = $scope.responseData;
}

然后我意识到$ scope.anotherObj是' undefined'。从.success获取返回数据的最简单方法是什么?

0 个答案:

没有答案