aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/service/scope.js16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/service/scope.js b/src/service/scope.js
index d6cf60c9..dba4de1d 100644
--- a/src/service/scope.js
+++ b/src/service/scope.js
@@ -323,7 +323,8 @@ function $RootScopeProvider(){
length,
dirty, ttl = 100,
next, current, target = this,
- watchLog = [];
+ watchLog = [],
+ logIdx, logMsg;
if (target.$$phase) {
throw Error(target.$$phase + ' already in progress');
@@ -355,12 +356,13 @@ function $RootScopeProvider(){
watch.last = copy(value);
watch.fn(current, value, ((last === initWatchVal) ? value : last));
if (ttl < 5) {
- if (!watchLog[4-ttl]) watchLog[4-ttl] = [];
- if (isFunction(watch.exp)) {
- watchLog[4-ttl].push('fn: ' + (watch.exp.name || watch.exp.toString()));
- } else {
- watchLog[4-ttl].push(watch.exp);
- }
+ logIdx = 4-ttl;
+ if (!watchLog[logIdx]) watchLog[logIdx] = [];
+ logMsg = (isFunction(watch.exp))
+ ? 'fn: ' + (watch.exp.name || watch.exp.toString())
+ : watch.exp;
+ logMsg += '; newVal: ' + toJson(value) + '; oldVal: ' + toJson(last);
+ watchLog[logIdx].push(logMsg);
}
}
} catch (e) {