Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Map Binder so you can do utility methods
- map("myBinder").toValue( this );
- // Map the singleton maps
- map("s1Map").toFactoryMethod("myBinder", "buildMap")
- .methodArg(name="mapType", value="1");
- // Map A service with a singleton map
- map("Service").to("path")
- .initArg(name="myMap", ref="s1Map");
- // Utility method to build singleton maps
- function buildMap(mapType){
- switch( arguments.mapType ){
- case 1 : {
- return {
- s1 = getInjector().getInstance('s1'),
- s2 = getInjector().getInstance('s2')
- };
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement