title: Services with ES6 (AngularJS)
body: <p>I'm having problems accessing Angular built-in services such as $http when creating a service with ES6.</p>
  
  <p>For example, I'm creating a "ResultsFinder" service that will do an AJAX call and then do some stuff. 
  The problem is that I only have access to $http on the constructor (if I pass it as an argument), but not on other methods (such as getResults).</p>
  
  <p>See this code example:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>(() =&gt; {
    'use strict';
  
    class ResultsFinder {
      constructor($http) {}
      getResults() {
        return 'ResultsFinder';
      }
    }
  
    /**
     * @ngdoc service
     * @name itemManager.service:ResultsFinder
     *
     * @description
     *
     */
    angular
      .module('itemManager')
      .service('ResultsFinder', ResultsFinder);
  }());</code></pre>
  </div>
  </div>
  </p>
  
  <p>Inside getResults I don't have access to $http. In order to have access I should do something that I don't feel right like this:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>(() =&gt; {
    'use strict';
  
    class ResultsFinder {
      constructor($http) {
        this.$http = $http;
      }
      getResults() {
        // Here I have access to this.$http
        return 'ResultsFinder';
      }
    }
  
    /**
     * @ngdoc service
     * @name itemManager.service:ResultsFinder
     *
     * @description
     *
     */
    angular
      .module('itemManager')
      .service('ResultsFinder', ResultsFinder);
  }());</code></pre>
  </div>
  </div>
  </p>
  
  <p>Anyone can give me some advice about the proper way to handle this?</p>