Im currently running an Electron app with an Angular frontend. I plan to extend the application by adding a second window that displays an different view of the same Angular frontend. Since the frontend relies heavily on dependency injection to react to internal model changes, it’s essential that both windows share the same model state. This way, any changes made in the main window are immediately reflected in the second window, and vice versa.
For instance, in the main window, a component injects a rendering manager object. When a button is pressed, it toggles the state of the rendering process—switching between running and stopped. I want this rendering to appear in the second window. Therefore, a component in that window must inject the same rendering manager to receive notifications about state changes and update its display accordingly.
I tried creating two windows in electron, loading the same angular app. However this will load separate instances of the angular pages with their own dependency injection container.
Is it possible to achieve such a setup in Electron that uses the same dependency injection provider (or angular instance) across multiple windows?