From 8f3f38d8c7f00d4bcbdba146911f2d19ff05093e Mon Sep 17 00:00:00 2001 From: chrismilleruk Date: Wed, 20 Mar 2013 08:42:33 +0000 Subject: [PATCH] Add ng-app: module; on bootstrap to allow a LATER angular-scenario.angularInit() to find the app element. --- app/lib/angular/angular.js | 6 ++++++ test/lib/angular/angular-scenario.js | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/app/lib/angular/angular.js b/app/lib/angular/angular.js index 68b33c7f92..fdc5100f0a 100644 --- a/app/lib/angular/angular.js +++ b/app/lib/angular/angular.js @@ -962,6 +962,12 @@ function bootstrap(element, modules) { scope.$apply(function() { element.data('$injector', injector); compile(element)(scope); + + // Handle angular-scenario.angularInit() race condition.. + // ..when it runs in the future + var cls = ': ' + modules[2] + ';'; + cls = 'ng-app' + (cls||''); + element.addClass(cls); }); }] ); diff --git a/test/lib/angular/angular-scenario.js b/test/lib/angular/angular-scenario.js index 538a799d12..2a0a3adaad 100644 --- a/test/lib/angular/angular-scenario.js +++ b/test/lib/angular/angular-scenario.js @@ -10367,6 +10367,12 @@ function bootstrap(element, modules) { scope.$apply(function() { element.data('$injector', injector); compile(element)(scope); + + // Handle angular-scenario.angularInit() race condition.. + // ..when it runs in the future + var cls = ': ' + modules[2] + ';'; + cls = 'ng-app' + (cls||''); + element.addClass(cls); }); }] );