[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:
Victor Woeltjen
2014-11-04 13:00:12 -08:00
parent 24591c67dd
commit 8e31b2b6e0
3 changed files with 45 additions and 1 deletions

View 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;
}
);

View File

@ -94,6 +94,10 @@ define(
extensionGroup[category]
);
});
// Return the application to which these extensions
// have been registered
return app;
}
customRegistrars = customRegistrars || {};

View File

@ -45,7 +45,7 @@ define(
return loader.loadBundles(bundleList)
.then(resolver.resolveBundles)
.then(registrar.registerExtensions)
.then(bootstrapper.bootstrapApplication);
.then(bootstrapper.bootstrap);
}