title: How to set pass data to another module component using BehaviourSubject
body: <p>I have used the following approach several times in my projects in order to pass data from one component to another. However, this time I have 2 component: parent (in AppModule) and sidebar (in CoreModule) components and I am trying to pass data from parent to sidebar on a dropdown change. However, it does not work and the <code>subscribe</code> method on the sidebar component (in the example child component) is not triggered except from initial loading. Does being on different modules cause this problem? Or any other issue about that?</p>
  <p>Here is the <a href="https://stackblitz.com/edit/angular-share-data-app-mzxjyc?file=src%2Fapp%2Fchild%2Fchild.component.ts" rel="nofollow noreferrer">DEMO</a>.</p>
  <p><em><strong>Update:</strong></em></p>
  <p>Here is my module relationship:</p>
  <p><em><strong>parent.module:</strong></em></p>
  <pre><code>imports: [
    SharedModule
  ],
  providers: []
  </code></pre>
  <br/>
  <p><em><strong>child.module:</strong></em></p>
  <pre><code>imports: [
    SharedModule
  ],
  providers: []
  </code></pre>
  <br/>
  <p><em><strong>shared.module:</strong></em></p>
  <pre><code>providers: [
      DataService
  ]
  </code></pre>
  <p>When I update as shown above, it still does not work. However, if I move <code>DataService</code> in the providers field from <code>shared.module</code> to <code>app.module</code> it works. But I think it should work when it is only in <code>shared.module</code> as shown above. Why?</p>