Created
June 9, 2010 20:27
-
-
Save squeedee/432118 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private function configureUnallocatedDataModel():void { | |
injector.mapSingleton(UnallocatedJobModel); | |
// a new injector context, already has it's parentInjector set | |
var loInjector:IInjector = injector.createChild(); | |
// get the configuration for LO mapping... | |
var loRule:InjectionConfig = injector.mapClass(ListObserver,ListObserver); | |
// ...so that we can configure the maping to use the new child injector... | |
loRule.setInjector(Injector(loInjector)); | |
// ...which we configure with extra mappings | |
loInjector.mapClass(ProxyManager, ProxyManager); | |
loInjector.mapSingletonOf(IProxyBuilder, UnallocatedProxyBuilder); | |
// create the Observer.. how will we manage lifetime? Possibly context level? | |
var lo:ListObserver = injector.getInstance(ListObserver); | |
lo.list = UnallocatedJobModel(injector.getInstance(UnallocatedJobModel)).list; | |
// and remove the child injector. | |
loRule.setInjector(null); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment