Shared service in Angular2
<p>I'm trying to make a shared service for my app. </p>

<pre><code>import { Injectable } from '@angular/core';

@Injectable()
export class SharedService {
  testService() {
    console.log('share!');
  }
}
</code></pre>

<p>Then I inject it in my app.component's providers but when I tried to call it in the constructor of a child component like this: <code>constructor(public sharedService: SharedService) {}</code> I've got an error: 
<code>Can't resolve all parameters for MyComponent</code>. I also tried to inject it in my app.module providers and also got this error. What should I do? How to inject it properly? Can anyone provide an example of proper shared service for antire app(it has several modules)? </p>

<p>I have routing sistem and I want to have a shared service and change it's data from the component which module is currently represented. </p>