MCPcopy Create free account
hub / github.com/apache/cloudstack / bootstrap

Function bootstrap

tools/ngui/static/js/lib/angular.js:970–1003  ·  view source on GitHub ↗

* @ngdoc function * @name angular.bootstrap * @description * Use this function to manually start up angular application. * * See: guide/bootstrap Bootstrap * * @param {Element} element DOM element which is the root of angular application. * @param {Array =} modules an

(element, modules)

Source from the content-addressed store, hash-verified

968 * @returns {AUTO.$injector} Returns the newly created injector for this app.
969 */
970function bootstrap(element, modules) {
971 var resumeBootstrapInternal = function() {
972 element = jqLite(element);
973 modules = modules || [];
974 modules.unshift(['$provide', function($provide) {
975 $provide.value('$rootElement', element);
976 }]);
977 modules.unshift('ng');
978 var injector = createInjector(modules);
979 injector.invoke(['$rootScope', '$rootElement', '$compile', '$injector',
980 function(scope, element, compile, injector) {
981 scope.$apply(function() {
982 element.data('$injector', injector);
983 compile(element)(scope);
984 });
985 }]
986 );
987 return injector;
988 };
989
990 var NG_DEFER_BOOTSTRAP = /^NG_DEFER_BOOTSTRAP!/;
991
992 if (window && !NG_DEFER_BOOTSTRAP.test(window.name)) {
993 return resumeBootstrapInternal();
994 }
995
996 window.name = window.name.replace(NG_DEFER_BOOTSTRAP, '');
997 angular.resumeBootstrap = function(extraModules) {
998 forEach(extraModules, function(module) {
999 modules.push(module);
1000 });
1001 resumeBootstrapInternal();
1002 };
1003}
1004
1005var SNAKE_CASE_REGEXP = /[A-Z]/g;
1006function snake_case(name, separator){

Callers 1

angularInitFunction · 0.85

Calls 4

resumeBootstrapInternalFunction · 0.85
forEachFunction · 0.85
replaceMethod · 0.80
testMethod · 0.45

Tested by

no test coverage detected