title: AngularJS access variable inside $http.get
body: <pre><code>app.controller('EntryCtrl', ['$scope', '$http', function($scope, $http){
      $http.get(something.json).success(function(data){
        $scope.entries = data;
      });
      abc = $scope.entries.timestamp;  &lt;-- not working
  }]);
  </code></pre>
  
  <p>After searching, found that $http is an asynchronous function. So I wrap it in to a function, but still not working.</p>
  
  <pre><code>app.controller('EntryCtrl', ['$scope', '$http', function($scope, $http){
      var getEntries = function(){ return
        $http.get(something.json).success(function(data){
          return data;
        });
      };
  
      $scope.entries = getEntries();
      console.log($scope.entries); // returns undefined
  }]);
  </code></pre>