Skip to content

Instantly share code, notes, and snippets.

@mchambaud
Created December 5, 2014 04:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mchambaud/35bd7c6fe83bf5de207e to your computer and use it in GitHub Desktop.
Save mchambaud/35bd7c6fe83bf5de207e to your computer and use it in GitHub Desktop.
Log all $rootScope.$emit
app.config(function ($provide) {
$provide.decorator('$rootScope', function ($delegate) {
var originalEmitFn = $delegate.$emit;
$delegate.$emit = function () {
console.log.apply(console, arguments);
originalEmitFn.apply(this, arguments)
}
return $delegate;
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment