aboutsummaryrefslogtreecommitdiffstats
path: root/src/ng/directive/input.js
diff options
context:
space:
mode:
authorIgor Minar2012-03-27 12:44:37 -0700
committerIgor Minar2012-03-28 16:57:22 -0700
commit35125d25137ac2da13ed1ca3e652ec8f2c945053 (patch)
tree387623dfc398e04c17ea15917d2d8e8cbf40bf19 /src/ng/directive/input.js
parent87f5c6e5b716100e203ec59c5874c3e927f83fa0 (diff)
downloadangular.js-35125d25137ac2da13ed1ca3e652ec8f2c945053.tar.bz2
refactor(toJson): use native JSON.stringify
Instead of using our custom serializer we now use the native one and use the replacer function to customize the serialization to preserve most of the previous behavior (ignore $ and $$ properties as well as window, document and scope instances).
Diffstat (limited to 'src/ng/directive/input.js')
-rw-r--r--src/ng/directive/input.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ng/directive/input.js b/src/ng/directive/input.js
index 348c9f25..7343c358 100644
--- a/src/ng/directive/input.js
+++ b/src/ng/directive/input.js
@@ -671,7 +671,7 @@ function checkboxInputType(scope, element, attr, ctrl) {
</doc:source>
<doc:scenario>
it('should initialize to model', function() {
- expect(binding('user')).toEqual('{"last":"visitor","name":"guest"}');
+ expect(binding('user')).toEqual('{"name":"guest","last":"visitor"}');
expect(binding('myForm.userName.$valid')).toEqual('true');
expect(binding('myForm.$valid')).toEqual('true');
});
@@ -685,7 +685,7 @@ function checkboxInputType(scope, element, attr, ctrl) {
it('should be valid if empty when min length is set', function() {
input('user.last').enter('');
- expect(binding('user')).toEqual('{"last":"","name":"guest"}');
+ expect(binding('user')).toEqual('{"name":"guest","last":""}');
expect(binding('myForm.lastName.$valid')).toEqual('true');
expect(binding('myForm.$valid')).toEqual('true');
});