Created
December 5, 2014 04:23
-
-
Save mchambaud/35bd7c6fe83bf5de207e to your computer and use it in GitHub Desktop.
Log all $rootScope.$emit
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
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