Permalink
Browse files

Added usage example for ClassProvider.

  • Loading branch information...
1 parent 2773374 commit ec0db704ddaed1a2c2b82299e1add14ee35489be @Stray Stray committed with Jul 17, 2012
Showing with 6 additions and 0 deletions.
  1. +6 −0 fallbackProviders.md
View
@@ -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.

0 comments on commit ec0db70

Please sign in to comment.