diff --git a/src/adapter/capabilities/AlternateCompositionCapability.js b/src/adapter/capabilities/AlternateCompositionCapability.js index dd2613e302..b84a42cc85 100644 --- a/src/adapter/capabilities/AlternateCompositionCapability.js +++ b/src/adapter/capabilities/AlternateCompositionCapability.js @@ -24,17 +24,16 @@ * Module defining AlternateCompositionCapability. Created by vwoeltje on 11/7/14. */ define([ - '../../api/objects/object-utils', - '../../api/composition/CompositionAPI' -], function (objectUtils, CompositionAPI) { + '../../api/objects/object-utils' +], function (objectUtils) { function AlternateCompositionCapability($injector, domainObject) { this.domainObject = domainObject; - this.getDependencies = function () { this.instantiate = $injector.get("instantiate"); this.contextualize = $injector.get("contextualize"); this.getDependencies = undefined; + this.openmct = $injector.get("openmct"); }.bind(this); } @@ -85,7 +84,12 @@ define([ this.domainObject.getModel(), this.domainObject.getId() ); - var collection = CompositionAPI(newFormatDO); + + if (this.getDependencies) { + this.getDependencies(); + } + + var collection = this.openmct.composition.get(newFormatDO); return collection.load() .then(function (children) { collection.destroy(); @@ -94,7 +98,7 @@ define([ }; AlternateCompositionCapability.appliesTo = function (model) { - return !!CompositionAPI(objectUtils.toNewFormat(model, model.id)); + return true; }; return AlternateCompositionCapability; diff --git a/src/api/telemetry/TelemetryAPI.js b/src/api/telemetry/TelemetryAPI.js index b9f2164e41..2619004c5c 100644 --- a/src/api/telemetry/TelemetryAPI.js +++ b/src/api/telemetry/TelemetryAPI.js @@ -297,7 +297,7 @@ define([ * @memberof module:openmct.TelemetryAPI~TelemetryProvider# */ _.forEach({ - request: Promise.reject("No such provider"), + request: undefined, subscribe: undefined, properties: [], formatter: undefined,