@@ -22,7 +22,7 @@ part of angular.directive;
22
22
publishTypes : const < Type > [NgControl ],
23
23
map: const { 'ng-form' : '@name' },
24
24
visibility: NgDirective .CHILDREN_VISIBILITY )
25
- class NgForm extends NgControl implements Map < String , NgControl > {
25
+ class NgForm extends NgControl {
26
26
/**
27
27
* Instantiates a new instance of NgForm. Upon creation, the instance of the
28
28
* class will be bound to the formName property on the scope (where formName
@@ -57,56 +57,10 @@ class NgForm extends NgControl implements Map<String, NgControl> {
57
57
}
58
58
}
59
59
60
- //FIXME: fix this reflection bug that shows up when Map is implemented
61
- operator []= (String key, value) {
62
- if (key == 'name' ) {
63
- name = value;
64
- } else {
65
- _controlByName[key] = value;
66
- }
67
- }
68
-
69
- //FIXME: fix this reflection bug that shows up when Map is implemented
70
- operator [](name) {
71
- if (name == 'valid' ) {
72
- return valid;
73
- } else if (name == 'invalid' ) {
74
- return invalid;
75
- } else {
76
- return _controlByName[name];
77
- }
78
- }
79
-
80
- bool get isEmpty => false ;
81
- bool get isNotEmpty => ! isEmpty;
82
- get values => null ;
83
- get keys => null ;
84
- get length => null ;
85
- clear () => null ;
86
- remove (_) => null ;
87
- containsKey (_) => false ;
88
- containsValue (_) => false ;
89
- addAll (_) => null ;
90
- forEach (_) => null ;
91
- putIfAbsent (_, __) => null ;
60
+ NgControl operator [](name) => _controlByName[name];
92
61
}
93
62
94
63
class NgNullForm extends NgNullControl implements NgForm {
95
64
NgNullForm () {}
96
-
97
65
operator [](name) {}
98
- operator []= (String name, value) {}
99
-
100
- bool get isEmpty => false ;
101
- bool get isNotEmpty => true ;
102
- get values => null ;
103
- get keys => null ;
104
- get length => null ;
105
- clear () => null ;
106
- remove (_) => null ;
107
- containsKey (_) => false ;
108
- containsValue (_) => false ;
109
- addAll (_) => null ;
110
- forEach (_) => null ;
111
- putIfAbsent (_, __) => null ;
112
66
}
0 commit comments