It seems that the problem caused by the Child scope is not configured when the $ rootScope event is fired. $ broadcast.
I resolved this example using:
App.run(function($rootScope, $timeout){ var text = 'Not So Static Now'; $timeout(function(){ $rootScope.$broadcast('event:staticText', text); }, 100); }).$inject = ['$rootScope'];
and
App.controller('Ctrl1', function($scope, $rootScope) { $scope.staticText = "Static Text"; var things = [ 'AngularJS', 'StackOverflow', 'JSFiddle' ]; $scope.$emit('event:things', things); $scope.$on('event:staticText', function(e, args){ $scope.$apply(function(){ $scope.staticText = args; }); }); }).$inject = ['$scope', '$rootScope'];
which can be seen here
Not sure if this is the best solution, but it works.
Josh holloway
source share