mirror of
https://github.com/nasa/openmct.git
synced 2025-06-13 20:58:15 +00:00
[Framework] Bring in changes from sandbox
Bring in changes from 'sandbox' branch. These include: * Reconfiguring require's baseUrl such that relative paths work as expected in define call dependencies. Previously this only worked as expected in the framework bundle, since data-main points there. * Add support for a 'constants' category of extension, to define application constants from bundles. This allows services to treat static values (such as persistence URIs) as injectable dependencies. * Various assurances that properties from extension definitions will be exposed upon resolved implementations, even after partial construction. WTD-572.
This commit is contained in:
@ -31,12 +31,21 @@ define(
|
||||
} :
|
||||
Object.create(impl);
|
||||
|
||||
Object.keys(definition).forEach(function (k) {
|
||||
result[k] = definition[k];
|
||||
// Copy over static properties
|
||||
Object.keys(impl).forEach(function (k) {
|
||||
result[k] = impl[k];
|
||||
});
|
||||
|
||||
// Copy over definition
|
||||
Object.keys(definition).forEach(function (k) {
|
||||
if (result[k] === undefined) {
|
||||
result[k] = definition[k];
|
||||
}
|
||||
});
|
||||
result.definition = definition;
|
||||
|
||||
// Log that this load was successful
|
||||
$log.info("Loaded " + extension.getLogName());
|
||||
$log.info("Resolved " + extension.getLogName());
|
||||
|
||||
return result;
|
||||
}
|
||||
|
Reference in New Issue
Block a user