Inheritance and dependency injection
<p>I have a set of angular2 components that should all get some service injected. My first thought was that it would be best to create a super class and inject the service there. Any of my components would then extend that superclass but this approach does not work.</p>

<p>Simplified example:</p>

<pre><code>export class AbstractComponent {
  constructor(private myservice: MyService) {
    // Inject the service I need for all components
  }
}

export MyComponent extends AbstractComponent {
  constructor(private anotherService: AnotherService) {
    super(); // This gives an error as super constructor needs an argument
  }
}
</code></pre>

<p>I could solve this by injecting <code>MyService</code> within each and every component and use that argument for the <code>super()</code> call but that's definetly some kind of absurd.</p>

<p>How to organize my components correctly so that they inherit a service from the super class?</p>