title: AngularJS - Get data immediatelly after call to query()
body: <p>I have a Service </p>
  
  <pre><code>angular.module('AigServices', ['ngResource']).factory('aiguilleurs', function($resource){
  
  var service = $resource('app/data/EpargneATermeRachetableCELI.json', {}, {
      query: {method:'GET', params:{}, isArray:true}});
  
  return service;  });
  </code></pre>
  
  <p>In my controller, when I call <code>aiguilleurs.query()</code>, I receive the structure but no data like it said in the doc.  I want to have the data has soon has I call the <code>query()</code>.  Any idea?  I have looked around and didn't find anything.  So the controller code follow (<code>$scope.listeAiguilleurs[0]</code> is always undefined):</p>
  
  <pre><code>$scope.listeAiguilleurs = aiguilleurs.query();   
  var questionEnCours = null;
  
  if ($scope.listeAiguilleurs[0] != null) {
      questionEnCours = $scope.listeAiguilleurs[0].questions[$scope.noQuestionEnCours-1];
  }
  $scope.questionEnCours = questionEnCours;
  </code></pre>