[Instantiation] Ensure new models have modified timestamp
...to avoid https://github.com/nasa/openmct/issues/745#issuecomment-204561163
This commit is contained in:
@@ -35,10 +35,16 @@ define(
|
||||
* @param $injector Angular's `$injector`
|
||||
* @implements {Capability}
|
||||
*/
|
||||
function InstantiationCapability($injector, identifierService, domainObject) {
|
||||
function InstantiationCapability(
|
||||
$injector,
|
||||
identifierService,
|
||||
now,
|
||||
domainObject
|
||||
) {
|
||||
this.$injector = $injector;
|
||||
this.identifierService = identifierService;
|
||||
this.domainObject = domainObject;
|
||||
this.now = now;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -57,6 +63,8 @@ define(
|
||||
space = parsedId.getDefinedSpace(),
|
||||
id = this.identifierService.generate(space);
|
||||
|
||||
model.modified = this.now();
|
||||
|
||||
// Lazily initialize; instantiate depends on capabilityService,
|
||||
// which depends on all capabilities, including this one.
|
||||
this.instantiateFn = this.instantiateFn ||
|
||||
|
||||
Reference in New Issue
Block a user