My component where all pages are loaded is like below:
<app-header></app-header>
<div>
<router-outlet></router-outlet>
</div>
<app-footer></app-footer>
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
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 .