aboutsummaryrefslogtreecommitdiffstats
path: root/src/directives.js
diff options
context:
space:
mode:
authorMisko Hevery2011-08-12 08:57:21 -0700
committerMisko Hevery2011-08-12 15:48:12 -0700
commit13e7df68a65b0dd2eb4eed673f7b8e3e702d72a9 (patch)
tree011b94faf6765790eea9df97f94d8c9cca96dc57 /src/directives.js
parent42062dab34192d2cb9ed66a720c0f791408c61c0 (diff)
downloadangular.js-13e7df68a65b0dd2eb4eed673f7b8e3e702d72a9.tar.bz2
perf(scope): re-enable statement cacheing
Diffstat (limited to 'src/directives.js')
-rw-r--r--src/directives.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/directives.js b/src/directives.js
index dd292de8..8ba5bace 100644
--- a/src/directives.js
+++ b/src/directives.js
@@ -205,6 +205,7 @@ angularDirective("ng:controller", function(expression){
*/
angularDirective("ng:bind", function(expression, element){
element.addClass('ng-binding');
+ var exprFn = parser(expression).statements();
return function(element) {
var lastValue = noop, lastError = noop;
this.$watch(function(scope) {
@@ -215,7 +216,7 @@ angularDirective("ng:bind", function(expression, element){
// TODO(misko): get rid of $element https://github.com/angular/angular.js/issues/348
scope.$element = element;
try {
- value = scope.$eval(expression);
+ value = exprFn(scope);
} catch (e) {
scope.$service('$exceptionHandler')(e);
error = formatError(e);