title: How to make a Service/Factory with $http in AngularJS 1.5+? (ES6)
body: <p>I'm using this <a href="https://github.com/AngularClass/NG6-starter" rel="nofollow noreferrer">boilerplate</a> for angular.js 1.5, I haven't work with the new angularjs sintax and am lost of how to use and inject <code>$http</code> for http request.</p>
  
  <p>In the past I would use an old angularjs service (<code>MyService</code>) and inside it inject $http then I would call in my controller the <code>MyService.getData()</code>, but with this new syntax I'm lost how to create a service and inject inside it $http and then use that service in a component.</p>
  
  <p>This is how the module file questions.js looks like:</p>
  
  <pre><code>import angular from 'angular';
  import uiRouter from 'angular-ui-router';
  import questionsComponent from './questions.component';
  
      let questionsModule = angular.module('questions', [
        uiRouter
      ])
      .component('questions', questionsComponent)
      .name;
  
      export default questionsModule;
  </code></pre>
  
  <p>The <code>questions.component.js</code>:</p>
  
  <pre><code>import template from './questions.html';
  import controller from './questions.controller';
  import './questions.scss';
  let questionsComponent = {
    bindings: {},
    template,
    controller
  };
  
  export default questionsComponent;
  </code></pre>
  
  <p>And finally the <code>questions.controller.js</code>:</p>
  
  <pre><code>class QuestionsController {
    constructor() {
      this.name = 'questions';
    }
  
    $onInit() {
      console.log("$onInit")
    }
  
    $onDestroy() {
      console.log("$onDestroy")
    }
  }
  
  export default QuestionsController;
  </code></pre>