Skip to content

Instantly share code, notes, and snippets.

@calendee
Last active February 15, 2017 17:16
Show Gist options
  • Save calendee/45eb8f0a777613d253de to your computer and use it in GitHub Desktop.
Save calendee/45eb8f0a777613d253de to your computer and use it in GitHub Desktop.
Fire Angular RootScope Event from Console, Get Get An AngularJS service
// Right click an element and select "Inspect Element"
// Courtesy : http://michalostruszka.pl/blog/2013/09/24/angularjs-in-browsers-console/ &
// http://ionicframework.com/blog/angularjs-console/
var scope = angular.element($0).scope();
var rootScope = scope.$root
scope.$apply( function() {
rootScope.$broadcast('showOffline', {msg : 'goes here', duration : 1230});
})
@calendee
Copy link
Author

calendee commented Feb 15, 2017

var body = document.getElementsByTagName('body')
var scope = angular.element(body[0]);

scope.$$listenerCount["batch-mode-changed"]
scope.$$listeners

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment