title: How to read data of $http request inside controller from a service?
body: <p>I'm trying to save the return value of $http service inside my controller, but I get "undefined" like response</p>
  
  <p>In my controller, I call a service that uses the $http:</p>
  
  <pre><code>//this returns undefined
  vm.user_instruments = instruments.getInstruments();
  </code></pre>
  
  <p>My service:</p>
  
  <pre><code>function instruments($http){
         this.getInstruments = function(){
           $http.get('url/').
            then(function(response) {
              /*this console.log print the response, 
              but this value I can't get it in my controller*/
              console.log(response.data);
              return response.data;
            }, function(error) {
              return error.data;
            });
         }
       }//end service
  </code></pre>
  
  <p><strong>So, what am I doing wrong?</strong> My purpose is that the controller be ignorant of any details of HTTP</p>