$scope.order_details=function(index){
    var temp_order_id=$scope.order_data[index].order_id;
    $http.get('http://web.com/app/order_details/'+temp_order_id).then(function(response){
        $scope.order_details11=response.data.data;
        console.log($scope.order_details11);//Working Fine
    });
}
console.log($scope.order_details11);//return undefined
This is an angularjs code on which I am working on when I console the array inside the $http.get(...) it is working fine but when I try to access that array outside the function it is returning undefined
 
    