@@ -10298,8 +10298,9 @@ function encodeUriQuery(val, pctEncodeSpaces) {
10298
10298
</doc:example>
10299
10299
*
10300
10300
*/
10301
- function angularInit(element, bootstrap ) {
10301
+ function angularInit(element, callback, errCallback ) {
10302
10302
var elements = [element],
10303
+ document = element.ownerDocument || element,
10303
10304
appElement,
10304
10305
module,
10305
10306
names = ['ng:app', 'ng-app', 'x-ng-app', 'data-ng-app'],
@@ -10338,7 +10339,9 @@ function angularInit(element, bootstrap) {
10338
10339
}
10339
10340
});
10340
10341
if (appElement) {
10341
- bootstrap(appElement, module ? [module] : []);
10342
+ callback(appElement, module ? [module] : []);
10343
+ } else if (callback !== bootstrap && errCallback) {
10344
+ errCallback();
10342
10345
}
10343
10346
}
10344
10347
@@ -10373,6 +10376,10 @@ function bootstrap(element, modules) {
10373
10376
var cls = ': ' + modules[2] + ';';
10374
10377
cls = 'ng-app' + (cls||'');
10375
10378
element.addClass(cls);
10379
+
10380
+ // ..when it has already run.
10381
+ var document = element[0].ownerDocument || element[0];
10382
+ JQLite(document.body).triggerHandler('ngBootstrap');
10376
10383
});
10377
10384
}]
10378
10385
);
@@ -24637,7 +24644,7 @@ angular.scenario.Application.prototype.executeAction = function(action) {
24637
24644
if (!$window.angular) {
24638
24645
return action.call(this, $window, _jQuery($window.document));
24639
24646
}
24640
- angularInit($window.document, function(element) {
24647
+ var scenarioBootstrap = function(element) {
24641
24648
var $injector = $window.angular.element(element).injector();
24642
24649
var $element = _jQuery(element);
24643
24650
@@ -24650,6 +24657,11 @@ angular.scenario.Application.prototype.executeAction = function(action) {
24650
24657
action.call(self, $window, $element);
24651
24658
});
24652
24659
});
24660
+ };
24661
+ angularInit($window.document, scenarioBootstrap, function(){
24662
+ $window.angular.element($window.document.body).bind('ngBootstrap', function(){
24663
+ angularInit($window.document, scenarioBootstrap);
24664
+ });
24653
24665
});
24654
24666
};
24655
24667
0 commit comments