From 47c454a315b6c0260c8f65e70ae9b30f924650df Mon Sep 17 00:00:00 2001 From: Misko Hevery Date: Fri, 10 Dec 2010 13:55:18 -0800 Subject: 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 --- src/Injector.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/Injector.js') diff --git a/src/Injector.js b/src/Injector.js index 78858e86..f6cb897f 100644 --- a/src/Injector.js +++ b/src/Injector.js @@ -67,4 +67,12 @@ function createInjector(providerScope, providers, cache) { } return returnValue; }; -} \ No newline at end of file +} + +function injectService(services, fn) { + return extend(fn, {$inject:services});; +} + +function injectUpdateView(fn) { + return injectService(['$updateView'], fn); +} -- cgit v1.2.3