From 06d0955074f79de553cc34fbf945045dc458e064 Mon Sep 17 00:00:00 2001
From: Vojta Jina
Date: Fri, 30 Mar 2012 12:07:19 -0700
Subject: feat(ngModel): update model on each key stroke (revert
ngModelInstant)
It turns out that listening only on "blur" event is not sufficient in many scenarios,
especially when you use form validation you always had to use ngModelnstant
e.g. if you want to disable a button based on valid/invalid form.
The feedback we got from our apps as well as external apps is that the
ngModelInstant should be the default.
In the future we might provide alternative ways of suppressing updates
on each key stroke, but it's not going to be the default behavior.
Apps already using the ngModelInstant can safely remove it from their
templates. Input fields without ngModelInstant directive will start propagating
the input changes into the model on each key stroke.
---
test/BinderSpec.js | 14 -----------
test/ng/directive/formSpec.js | 15 ++++++-----
test/ng/directive/inputSpec.js | 57 +++++++++++-------------------------------
3 files changed, 24 insertions(+), 62 deletions(-)
(limited to 'test')
diff --git a/test/BinderSpec.js b/test/BinderSpec.js
index 306cbc43..6d5dd91e 100644
--- a/test/BinderSpec.js
+++ b/test/BinderSpec.js
@@ -142,20 +142,6 @@ describe('Binder', function() {
expect(html.indexOf('action="foo();"')).toBeGreaterThan(0);
});
- it('RepeaterAdd', inject(function($rootScope, $compile) {
- element = $compile('
')($rootScope);
- $rootScope.items = [{x:'a'}, {x:'b'}];
- $rootScope.$apply();
- var first = childNode(element, 1);
- var second = childNode(element, 2);
- expect(first.val()).toEqual('a');
- expect(second.val()).toEqual('b');
-
- first.val('ABC');
- browserTrigger(first, 'blur');
- expect($rootScope.items[0].x).toEqual('ABC');
- }));
-
it('ItShouldRemoveExtraChildrenWhenIteratingOverHash', inject(function($rootScope, $compile) {
element = $compile('