Skip to content

Instantly share code, notes, and snippets.

@letsar
Created September 8, 2018 18:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save letsar/a28d5f621a36e27f2ad964dabb68e5f4 to your computer and use it in GitHub Desktop.
Save letsar/a28d5f621a36e27f2ad964dabb68e5f4 to your computer and use it in GitHub Desktop.
class Service {}
class ServiceA extends Service {}
class ServiceB extends Service {
ServiceB(ServiceA serviceA);
}
...
// Registers a complex factory by resolving the dependency
// when the type is resolved.
container.registerFactory((c) => ServiceB(c.resolve<ServiceA>()));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment