Created
September 5, 2017 13:22
-
-
Save matyasfodor/ed97fb440a1e1a3c17581c17961b96d8 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
// Hack for monkey patching $scope.$watch | |
this.$scope.$watch = ((originalWatchFn) => { | |
const scope = this.$scope; | |
// tslint:disable-next-line | |
return function(watchExpression, listener, objectEquality) { | |
// tslint:disable-next-line | |
const wrappedCB = function () { | |
console.log(watchExpression, arguments[0], arguments[1]); | |
listener.apply(null, arguments); | |
}; | |
return originalWatchFn.apply(scope, [watchExpression, wrappedCB, objectEquality]); | |
}; | |
})(this.$scope.$watch); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment