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

Commit

Permalink
perf($compile): watch interpolated expressions individually
Browse files Browse the repository at this point in the history
  • Loading branch information
rodyhaddad authored and IgorMinar committed Apr 21, 2014
1 parent 88c2193 commit 0ebfa0d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/ng/compile.js
Original file line number Diff line number Diff line change
Expand Up @@ -1804,9 +1804,9 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
bindings = parent.data('$binding') || [];
bindings.push(interpolateFn);
safeAddClass(parent.data('$binding', bindings), 'ng-binding');
scope.$watch(interpolateFn, function interpolateFnWatchAction(value) {
scope.$watchGroup(interpolateFn.expressions, interpolateFn.$$invoke(function(value) {
node[0].nodeValue = value;
});
}));
})
});
}
Expand Down Expand Up @@ -1867,7 +1867,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
attr[name] = interpolateFn(scope);
($$observers[name] || ($$observers[name] = [])).$$inter = true;
(attr.$$observers && attr.$$observers[name].$$scope || scope).
$watch(interpolateFn, function interpolateFnWatchAction(newValue, oldValue) {
$watchGroup(interpolateFn.expressions, interpolateFn.$$invoke(function (newValue, oldValue) {
//special case for class attribute addition + removal
//so that class changes can tap into the animation
//hooks provided by the $animate service. Be sure to
Expand All @@ -1879,7 +1879,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
} else {
attr.$set(name, newValue);
}
});
}));
}
};
}
Expand Down

1 comment on commit 0ebfa0d

@timkindberg
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hell yeah Rody!

Please sign in to comment.