I have a simple reproduction of what I want to achieve here on stackblitz:
I have a component (here it’s the app.component) which a service is declared on (MyService).
I need a new instance of MyService each time the component gets opened, so it seems right to me, that the service is declared on component level and not in the module.
Now I want to open a dialog (MatDialog -> TestComponent) from this component which needs the same service instance.
I get a StaticInjectorError as seen in the console output.
How can I use the same service instance in my dialog as my calling component has?
Source: New feed
Source Url Propagating service instance to dialog component not working as expected