I have a shared component alert which displays different alerts (error, success..) that uses a service 'alertService'.
I have different components that uses the 'alertService'.
The alert component is called in the appComponent like so:
<app-alert></app-alert>
When I call the service from another component the alert isn't displayed, it displays only when I call <app-alert></app-alert>
in the component that call the service.
solution: I provide the alert service in the app.module It was provided in the shared.module.