[Creation] Use instantiate service

...from instantiation capability.
This commit is contained in:
Victor Woeltjen
2015-11-06 14:15:22 -08:00
parent d059116782
commit 81b136eab1
2 changed files with 28 additions and 31 deletions

View File

@ -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);
};
/**