Forked from sebastianzillessen/print-broadcasts.js
Last active
August 29, 2015 14:22
-
-
Save elparkino/f99b0b0b82915d614945 to your computer and use it in GitHub Desktop.
This file contains 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
angular.module('print-broadcasts', []).config(['$provide', function ($provide) { | |
$provide.decorator('$rootScope', function ($delegate) { | |
var _emit = $delegate.$emit; | |
var _broadcast = $delegate.$broadcast; | |
$delegate.$emit = function () { | |
console.log("[$emit] " + arguments[0] + " (" + JSON.stringify(arguments) + ")"); | |
return _emit.apply(this, arguments); | |
}; | |
$delegate.$broadcast = function () { | |
console.log("[$broadcast] " + arguments[0] + " (" + JSON.stringify(arguments) + ")"); | |
return _broadcast.apply(this, arguments); | |
}; | |
return $delegate; | |
}); | |
}]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment