This repository was archived by the owner on Feb 22, 2018. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +15
-9
lines changed Expand file tree Collapse file tree 1 file changed +15
-9
lines changed Original file line number Diff line number Diff line change @@ -181,9 +181,11 @@ class NgModel extends NgControl implements NgAttachAware {
181
181
_modelValue = value;
182
182
setter (value);
183
183
184
- modelValue == _originalValue
185
- ? markAsPristine ()
186
- : markAsDirty ();
184
+ if (modelValue == _originalValue) {
185
+ markAsPristine ();
186
+ } else {
187
+ markAsDirty ();
188
+ }
187
189
}
188
190
189
191
List <NgValidator > get validators => _validators;
@@ -195,15 +197,19 @@ class NgModel extends NgControl implements NgAttachAware {
195
197
_toBeValidated = false ;
196
198
if (validators.isNotEmpty) {
197
199
validators.forEach ((validator) {
198
- validator.isValid (modelValue) == false
199
- ? this .addError (validator.name)
200
- : this .removeError (validator.name);
200
+ if (validator.isValid (modelValue)) {
201
+ removeError (validator.name);
202
+ } else {
203
+ addError (validator.name);
204
+ }
201
205
});
202
206
}
203
207
204
- invalid
205
- ? addInfo (NgControl .NG_INVALID )
206
- : removeInfo (NgControl .NG_INVALID );
208
+ if (invalid) {
209
+ addInfo (NgControl .NG_INVALID );
210
+ } else {
211
+ removeInfo (NgControl .NG_INVALID );
212
+ }
207
213
}
208
214
209
215
/**
You can’t perform that action at this time.
0 commit comments