mirror of
https://github.com/nasa/openmct.git
synced 2025-02-01 00:45:41 +00:00
[Persistence] User identifierService from instantiate
This commit is contained in:
parent
1d13b245f9
commit
87684e0945
@ -22,8 +22,8 @@
|
||||
/*global define,Promise*/
|
||||
|
||||
define(
|
||||
['../objects/DomainObjectImpl', 'uuid'],
|
||||
function (DomainObjectImpl, uuid) {
|
||||
['../objects/DomainObjectImpl'],
|
||||
function (DomainObjectImpl) {
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
@ -39,12 +39,15 @@ define(
|
||||
*
|
||||
* @constructor
|
||||
* @memberof platform/core
|
||||
* @param $injector Angular's `$injector`
|
||||
* @param {CapabilityService} capabilityService the service which will
|
||||
* provide instantiated domain objects with their capabilities
|
||||
* @param {IdentifierService} identifierService service to generate
|
||||
* new identifiers
|
||||
*/
|
||||
function Instantiate(capabilityService) {
|
||||
function Instantiate(capabilityService, identifierService) {
|
||||
return function (model, id) {
|
||||
var capabilities = capabilityService.getCapabilities(model);
|
||||
id = id || uuid();
|
||||
id = id || identifierService.generate();
|
||||
return new DomainObjectImpl(id, model, capabilities);
|
||||
};
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user