Last active
February 15, 2017 17:16
-
-
Save calendee/45eb8f0a777613d253de to your computer and use it in GitHub Desktop.
Fire Angular RootScope Event from Console, Get Get An AngularJS service
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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}); | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
var body = document.getElementsByTagName('body')
var scope = angular.element(body[0]);
scope.$$listenerCount["batch-mode-changed"]
scope.$$listeners