aboutsummaryrefslogtreecommitdiffstats
path: root/test/BinderSpec.js
diff options
context:
space:
mode:
authorMisko Hevery2010-12-10 13:55:18 -0800
committerIgor Minar2011-01-07 14:39:46 -0800
commit47c454a315b6c0260c8f65e70ae9b30f924650df (patch)
tree3392daf6242d540a6f3d7bb08ef4914aa46c667e /test/BinderSpec.js
parent16086aa37c5c0c98f5c4a42d2a15136bb6d18605 (diff)
downloadangular.js-47c454a315b6c0260c8f65e70ae9b30f924650df.tar.bz2
change to keydown from keyup; add delayed $updateView
- There was a perceived lag when typing do to the fact that we were listening on the keyup event instead of keydown. The issue with keydown is that we can not read the value of the input field. To solve this we schedule a defer call and perform the model update then. - To prevent calling $eval on root scope too many times as well as to prevent drowning the browser with too many updates we now call the $eval only after 25ms and any additional requests get ignored. The new update service is called $updateView
Diffstat (limited to 'test/BinderSpec.js')
-rw-r--r--test/BinderSpec.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/test/BinderSpec.js b/test/BinderSpec.js
index 9515accb..33bcb091 100644
--- a/test/BinderSpec.js
+++ b/test/BinderSpec.js
@@ -248,7 +248,8 @@ describe('Binder', function(){
assertEquals('b', second.val());
first.val('ABC');
- browserTrigger(first, 'keyup');
+ browserTrigger(first, 'keydown');
+ c.scope.$service('$browser').defer.flush();
assertEquals(c.scope.items[0].x, 'ABC');
});