title: Injected dependencies not accessible in class methods for AngularJS
body: <p>I'm using ES6 classes for Angular controllers and I'm running into a slight annoyance with dependency injection. Take this controller, for example (obviously not a real class).</p>
  
  <pre><code>class PersonController {
    constructor(MyDependency) {
      MyDependency.test(); // this works
    }
  
    sendEvent() {
      MyDependency.test(); // MyDependency is undefined
    }
  }
  
  PersonController.$inject = ['MyDependency'];
  
  export default PersonController;
  </code></pre>
  
  <p>When the constructor is run, the dependency is found fine. However if I call the <code>sendEvent</code> method (or any other class method), the dependency is no longer defined. I've gotten around this before by just attaching it to <code>this</code> in the constructor e.g. <code>this.MyDependency = MyDependency;</code>.</p>
  
  <p>Is there any other way that this can be achieved without hanging the dependency off <code>this</code>?</p>