[Framework] Wire in service compositor

Use service compositor as a form of custom registrar.
Also, add clarifying comments. WTD-518.
This commit is contained in:
Victor Woeltjen
2014-11-05 16:42:15 -08:00
parent 67dac667cf
commit 9e61e89da4
2 changed files with 38 additions and 3 deletions

View File

@@ -75,6 +75,12 @@ define(
}]);
}
// Handle service compositing
function registerComponents(components) {
return new ServiceCompositor(app, $log)
.registerCompositeServices(components);
}
// Utility; create a function which converts another function
// (which acts on single objects) to one which acts upon arrays.
function mapUpon(func) {
@@ -90,7 +96,8 @@ define(
routes: mapUpon(registerRoute),
directives: mapUpon(new CustomRegistrar("directive")),
controllers: mapUpon(new CustomRegistrar("controller")),
services: mapUpon(new CustomRegistrar("service"))
services: mapUpon(new CustomRegistrar("service")),
components: registerComponents
};
}