Created
July 30, 2015 12:18
-
-
Save calamarico/fe228afbed495680fa97 to your computer and use it in GitHub Desktop.
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
function instrumentedWatch(watchExpression, listener, objectEquality) { | |
// jshint validthis:true | |
var watchTimingSet = false; | |
if (!watchTiming) { | |
// Capture watch timing (and its key) once, before we descend in $$watchDelegates. | |
watchTiming = createTiming(formatExpression(watchExpression)); | |
watchTimingSet = true; | |
} | |
if (watchExpression && watchExpression.indexOf && watchExpression.indexOf('|') !== -1) { | |
console.log('bingo'); | |
} | |
originalWatch.call(this, watchExpression, listener, objectEquality); | |
// try { | |
// if (angular.isString(watchExpression)) { | |
// if (!$parse) { | |
// angular.injector(['ng']).invoke(['$parse', function(parse) {$parse = parse;}]); | |
// } | |
// watchExpression = $parse(watchExpression); | |
// } | |
// if (watchExpression && watchExpression.$$watchDelegate) { | |
// return originalWatch.call(this, watchExpression, listener, objectEquality); | |
// } else { | |
// return originalWatch.call( | |
// this, wrapExpression(watchExpression, watchTiming, 'watch', true, false), | |
// wrapListener(listener, watchTiming), objectEquality); | |
// } | |
// } finally { | |
// if (watchTimingSet) watchTiming = null; | |
// } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment