Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added usage example for ClassProvider.

  • Loading branch information...
commit ec0db704ddaed1a2c2b82299e1add14ee35489be 1 parent 2773374
@Stray Stray authored committed
Showing with 6 additions and 0 deletions.
  1. +6 −0 fallbackProviders.md
View
6 fallbackProviders.md
@@ -50,6 +50,12 @@ If there is a fallbackProvider it will be checked.
- Can provide an injector-instantiated instance of any Class.
- Does not support interfaces.
+To configure your injector to always allow instantiation of unmapped types requested for injection, just do:
+
+ injector.fallbackProvider = ClassProvider;
+
+The `ClassProvider` uses `injector.instantiateUnmapped` internally, so injected types can have nested injections fulfilled too.
+
## `instantiateUnmapped` always returns a fresh instance
- Regardless of any mappings.
Please sign in to comment.
Something went wrong with that request. Please try again.