on the following jsFiddle i demonstrate a problem that makes me ponder. It stems from the need to send a system wide event to all scopes, telling them that the system has finished bootstrapping. In order to do that, i got the rootScope after bootstrapping, and called its evalAsync. Alas! its not executing.
see here: http://jsfiddle.net/cusrC/8/
angular.element(document).ready(function() {
angular.bootstrap(body, ['app']);
var ngInjector = angular.injector(['ng']);
var rootScope = ngInjector.get('$rootScope');
var x = rootScope.$eval(function(scope) {
console.log('in eval');
scope.$broadcast('onLoad');
scope.$evalAsync(function(scope) {
console.log('in evalAsync');
scope.$broadcast('onLoad');
});
});
console.log('x',x);
console.log('after');
});
many thanks for any idea or thought Lior