mirror of
https://github.com/nasa/openmct.git
synced 2025-06-18 15:18:12 +00:00
[API] UMD Packaging (#1078)
* [Bundle] load filter with requirejs * [Build] Use almond, wrap in UMD Use almond for built version of application and wrap in UMD so that it supports requirejs, commonjs, and basic browser loading. * [Main] Can choose where to load app MCT.run allows you to specify a dom element to load application within. If element is not specified, will use body. * [MCT] set class on injected div Set class on injected div so extra markup is not required. * [Build] Re-enable optimize * Add minimal bootstrap example
This commit is contained in:
9
main.js
9
main.js
@ -105,7 +105,14 @@ define([
|
||||
var mct = new MCT();
|
||||
|
||||
mct.legacyRegistry = legacyRegistry;
|
||||
mct.run = mct.start;
|
||||
mct.run = function (domElement) {
|
||||
if (!domElement) { domElement = document.body; }
|
||||
var appDiv = document.createElement('div');
|
||||
appDiv.setAttribute('ng-view', '');
|
||||
appDiv.className = 'user-environ';
|
||||
domElement.appendChild(appDiv);
|
||||
mct.start();
|
||||
};
|
||||
mct.on('start', function () {
|
||||
return new Main().run(legacyRegistry);
|
||||
});
|
||||
|
Reference in New Issue
Block a user