mirror of
https://github.com/nasa/openmct.git
synced 2025-06-18 07:08:12 +00:00
[Framework] Add bootstrapper
Add an application bootstrapper, responsible for handling the Angular bootstrapping phase of framework layer initialization. WTD-518.
This commit is contained in:
40
platform/framework/src/ApplicationBootstrapper.js
Normal file
40
platform/framework/src/ApplicationBootstrapper.js
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
/*global define,Promise*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Module defining Bootstrapper. Created by vwoeltje on 11/4/14.
|
||||||
|
*
|
||||||
|
* The bootstrapper is responsible
|
||||||
|
*/
|
||||||
|
define(
|
||||||
|
[],
|
||||||
|
function () {
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The application bootstrapper is responsible for issuing the
|
||||||
|
* bootstrap call to Angular. This would normally not be needed
|
||||||
|
* with an appropriately-placed ng-app directive, but the
|
||||||
|
* framework needs to wait until all extensions have been loaded
|
||||||
|
* and registered.
|
||||||
|
*
|
||||||
|
* @constructor
|
||||||
|
*/
|
||||||
|
function ApplicationBootstrapper(angular, document) {
|
||||||
|
return {
|
||||||
|
/**
|
||||||
|
* @method
|
||||||
|
* @memberof ApplicationBootstrapper#
|
||||||
|
* @param {angular.Module} app the Angular application to
|
||||||
|
* bootstrap
|
||||||
|
*/
|
||||||
|
bootstrap: function (app) {
|
||||||
|
angular.element(document).ready(function () {
|
||||||
|
angular.bootstrap(document, [app.name]);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
return ApplicationBootstrapper;
|
||||||
|
}
|
||||||
|
);
|
@ -94,6 +94,10 @@ define(
|
|||||||
extensionGroup[category]
|
extensionGroup[category]
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Return the application to which these extensions
|
||||||
|
// have been registered
|
||||||
|
return app;
|
||||||
}
|
}
|
||||||
|
|
||||||
customRegistrars = customRegistrars || {};
|
customRegistrars = customRegistrars || {};
|
||||||
|
@ -45,7 +45,7 @@ define(
|
|||||||
return loader.loadBundles(bundleList)
|
return loader.loadBundles(bundleList)
|
||||||
.then(resolver.resolveBundles)
|
.then(resolver.resolveBundles)
|
||||||
.then(registrar.registerExtensions)
|
.then(registrar.registerExtensions)
|
||||||
.then(bootstrapper.bootstrapApplication);
|
.then(bootstrapper.bootstrap);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user