Skip to content

Instantly share code, notes, and snippets.

@mrded
Last active August 29, 2015 14:04
Show Gist options
  • Save mrded/e5e8191d44f99725eb08 to your computer and use it in GitHub Desktop.
Save mrded/e5e8191d44f99725eb08 to your computer and use it in GitHub Desktop.
AngularJS: Initial
angular.element(document).ready(function() {
var $inj = angular.bootstrap(document.body, ['use']);
var $rootScope = $inj.get("$rootScope");
$rootScope.$broadcast("init", "hello");
$rootScope.$digest();
});
.controller("FooCtrl", ["$scope", function($scope) {
$scope.$on("init", function(ev, data){
console.log('::init', data);
});
}]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment