Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

refactor($parse): simplify constantWatchDelegate #13176

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions src/ng/parse.js
Original file line number Diff line number Diff line change
Expand Up @@ -1894,13 +1894,9 @@ function $ParseProvider() {
function constantWatchDelegate(scope, listener, objectEquality, parsedExpression) {
var unwatch;
return unwatch = scope.$watch(function constantWatch(scope) {
return parsedExpression(scope);
}, function constantListener(value, old, scope) {
if (isFunction(listener)) {
listener.apply(this, arguments);
}
unwatch();
}, objectEquality);
return parsedExpression(scope);
}, listener, objectEquality);
}

function addInterceptor(parsedExpression, interceptorFn) {
Expand Down