DEV Community

Discussion on: Angular dynamic modules at runtime with Module Federation

Collapse
 
seanperkins profile image
Sean Perkins

You are unable to pass injection token instances between boundaries (shell to remote) at this time. It will always create a new instance, so you can use factories if you expect a default value. Instead of sharing tokens, you are likely better off using a service instance and sharing that between shell to remote. You can also use service workers, DOM events and other messaging-based solutions to pass the needed context you would otherwise be using a token for.