mirror of
https://github.com/nasa/openmct.git
synced 2025-01-31 08:25:31 +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;
|
||||
|
||||
function loadImplementation(extension) {
|
||||
var implPath = extension.getImplementationPath(),
|
||||
implPromise = loader.load(implPath),
|
||||
var implValue = extension.getImplementationPath(),
|
||||
implPromise = (typeof implValue === 'string') ?
|
||||
loader.load(implValue) :
|
||||
Promise.resolve(implValue),
|
||||
definition = extension.getDefinition();
|
||||
|
||||
// Wrap a constructor function (to avoid modifying the original)
|
||||
@ -120,7 +122,7 @@ define(
|
||||
// Log that loading has begun
|
||||
$log.info([
|
||||
"Loading implementation ",
|
||||
implPath,
|
||||
implValue,
|
||||
" for extension ",
|
||||
extension.getLogName()
|
||||
].join(""));
|
||||
|
Loading…
x
Reference in New Issue
Block a user