angularjs - $scope variable has no content -
angularjs - $scope variable has no content - i had controller , function getdata shown. problem $scope.results outside loop has no content. while within sec http.get request, has content. appcontrollers.controller('myasellerorderctrl', ['$scope', '$rootscope', 'order', '$http', function($scope, $rootscope, order, $http) { $scope.results = []; $scope.getdata = function() { $http.get('api/orders/business/?user_id=' + $rootscope.user.user_id).success(function(data){ (var = 0; < data.length; i++) { $http.get('api/orders/seller/?business_id=' + data[i].business_id).success(function(data1){ // console.log(data1); $scope.results[i] = data1; }); } console.log($scope.results); }); }; $sc