title: Share data with a static component - Angular
body: <p>My component where all pages are loaded is like below:</p>
  
  <pre><code>&lt;app-header&gt;&lt;/app-header&gt;
  &lt;div&gt;
  
    &lt;router-outlet&gt;&lt;/router-outlet&gt;
  &lt;/div&gt;
  &lt;app-footer&gt;&lt;/app-footer&gt;
  </code></pre>
  
  <p>My need is to display some alerts below header bar inside header component on any action that triggers messageservice in any of the components that replace router outlet. 
  I have a common messageService which is used across components and is also added as provider in app.module.ts</p>
  
  <p>My problem is, header is static , means no event occurs except on page load. Due to this, even when messageService is triggered, even when i place subscribe in constructor or onInit, definitely subscription wouldn't happen. I am unsure how can i get value from subscription in header component. Please favour . </p>