Skip to content

Instantly share code, notes, and snippets.

@letsar
Created September 8, 2018 18:08
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/ee184a5a05f30ba1b6a70c7fd42ad9c7 to your computer and use it in GitHub Desktop.
Save letsar/ee184a5a05f30ba1b6a70c7fd42ad9c7 to your computer and use it in GitHub Desktop.
// Gets the instance registered for the Sith type.
Sith theSith = container.resolve<Sith>();
// Gets the instance registered for the Sith type under 'DartVader' name.
Sith dartVader = container.resolve<Sith>('DartVader');
// Container is a callable class, so you can also resolve a type like this:
Sith sith = container<Sith>();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment