mirror of
https://github.com/nasa/openmct.git
synced 2025-06-11 03:41:37 +00:00
[API] Allow implementations to be passed directly
Allow implementations to be passed in as values, instead of strings, facilitating the loading of said implementations via RequireJS.
This commit is contained in:
parent
82990152d7
commit
4ed1836ae5
@ -61,8 +61,10 @@ define(
|
|||||||
$log = this.$log;
|
$log = this.$log;
|
||||||
|
|
||||||
function loadImplementation(extension) {
|
function loadImplementation(extension) {
|
||||||
var implPath = extension.getImplementationPath(),
|
var implValue = extension.getImplementationPath(),
|
||||||
implPromise = loader.load(implPath),
|
implPromise = (typeof implValue === 'string') ?
|
||||||
|
loader.load(implValue) :
|
||||||
|
Promise.resolve(implValue),
|
||||||
definition = extension.getDefinition();
|
definition = extension.getDefinition();
|
||||||
|
|
||||||
// Wrap a constructor function (to avoid modifying the original)
|
// Wrap a constructor function (to avoid modifying the original)
|
||||||
@ -120,7 +122,7 @@ define(
|
|||||||
// Log that loading has begun
|
// Log that loading has begun
|
||||||
$log.info([
|
$log.info([
|
||||||
"Loading implementation ",
|
"Loading implementation ",
|
||||||
implPath,
|
implValue,
|
||||||
" for extension ",
|
" for extension ",
|
||||||
extension.getLogName()
|
extension.getLogName()
|
||||||
].join(""));
|
].join(""));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user