[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

@ -4,7 +4,7 @@
{ {
"category": "composition", "category": "composition",
"implementation": "CompositionPolicy.js", "implementation": "CompositionPolicy.js",
"depends": [ "typeService", "capabilityService" ], "depends": [ "$injector" ],
"message": "Objects of this type cannot contain objects of that type." "message": "Objects of this type cannot contain objects of that type."
}, },
{ {

View File

@ -53,5 +53,7 @@ define(
}; };
} }
return ComposeActionPolicy;
} }
); );

View File

@ -8,10 +8,17 @@ define(
/** /**
* Defines composition policy as driven by type metadata. * 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 // We're really just wrapping the containment table and rephrasing
// it as a policy decision. // 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 { return {
/** /**
@ -19,7 +26,7 @@ define(
* contain the type described by the context? * contain the type described by the context?
*/ */
allow: function (candidate, context) { allow: function (candidate, context) {
return table.canContain(candidate, context); return getTable().canContain(candidate, context);
} }
}; };
} }

View File

@ -231,6 +231,7 @@
"description": "A panel for collecting telemetry elements.", "description": "A panel for collecting telemetry elements.",
"delegates": [ "telemetry" ], "delegates": [ "telemetry" ],
"features": "creation", "features": "creation",
"contains": [ { "has": "telemetry" } ],
"model": { "composition": [] }, "model": { "composition": [] },
"properties": [ "properties": [
{ {