title: How to access the result outside the $http.get in Angularjs
body: <p>How can I access the result of the <code>$http.get</code> outside of its success callback function?</p>
  
  <p>My code is</p>
  
  <pre><code>$http.get('http://myserver/' + $scope.myE)
          .success(function(data) 
          {
              $scope.mydata = data;
  
          });
  
  alert(JSON.stringify($scope.mydata));
  </code></pre>
  
  <p>I got undefined.</p>