[Creation] Tweak lazy initialization approach

This commit is contained in:
Victor Woeltjen 2015-11-06 14:32:47 -08:00
parent c184a9ce7c
commit cb432051dc

View File

@ -48,8 +48,11 @@ define(
* @returns {DomainObject} the new domain object
*/
InstantiationCapability.prototype.instantiate = function (model) {
this.instantiate = this.$injector.get("instantiate");
return this.instantiate(model);
// Lazily initialize; instantiate depends on capabilityService,
// which depends on all capabilities, including this one.
this.instantiateFn = this.instantiateFn ||
this.$injector.get("instantiate");
return this.instantiateFn(model);
};
/**