[Containment] Fix bundle

Fix dependencies in containment bundle to allow loading,
WTD-962.
This commit is contained in:
Victor Woeltjen
2015-04-07 21:03:36 -07:00
parent 24b1e3134e
commit 9e4611bcfd
4 changed files with 14 additions and 4 deletions

View File

@ -8,10 +8,17 @@ define(
/**
* Defines composition policy as driven by type metadata.
*/
function CompositionPolicy(typeService, capabilityService) {
function CompositionPolicy($injector) {
// We're really just wrapping the containment table and rephrasing
// it as a policy decision.
var table = new ContainmentTable(typeService, capabilityService);
var table;
function getTable() {
return (table = table || new ContainmentTable(
$injector.get('typeService'),
$injector.get('capabilityService')
));
}
return {
/**
@ -19,7 +26,7 @@ define(
* contain the type described by the context?
*/
allow: function (candidate, context) {
return table.canContain(candidate, context);
return getTable().canContain(candidate, context);
}
};
}