mirror of
https://github.com/nasa/openmct.git
synced 2025-06-18 07:08:12 +00:00
[Creation] Use instantiate service
...from instantiation capability.
This commit is contained in:
@ -38,20 +38,6 @@ define(
|
||||
this.$injector = $injector;
|
||||
}
|
||||
|
||||
/**
|
||||
* Alias of `capabilityService.getCapabilities`; handles lazy loading
|
||||
* of `capabilityService`, since it cannot be declared as a
|
||||
* dependency directly without creating a cycle.
|
||||
* @private
|
||||
*/
|
||||
CreationCapability.prototype.getCapabilities = function (model) {
|
||||
if (!this.capabilityService) {
|
||||
this.capabilityService =
|
||||
this.$injector.get('capabilityService');
|
||||
}
|
||||
return this.capabilityService.getCapabilities(model);
|
||||
};
|
||||
|
||||
/**
|
||||
* Instantiate a new domain object with the provided model.
|
||||
*
|
||||
@ -62,9 +48,8 @@ define(
|
||||
* @returns {DomainObject} the new domain object
|
||||
*/
|
||||
CreationCapability.prototype.instantiate = function (model) {
|
||||
var id = uuid(),
|
||||
capabilities = this.getCapabilities(model);
|
||||
return new DomainObjectImpl(id, model, capabilities);
|
||||
this.instantiate = this.$injector.get("instantiate");
|
||||
return this.instantiate(model);
|
||||
};
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user