@@ -145,9 +145,9 @@ class NgModel extends NgControl implements AttachAware {
145
145
if (_watch!= null ) _watch.remove ();
146
146
if (_watchCollection) {
147
147
_watch = _scope.watch (_expression, (changeRecord, _) {
148
- onChange (changeRecord is CollectionChangeRecord
149
- ? changeRecord.iterable
150
- : changeRecord);
148
+ onChange (changeRecord is CollectionChangeRecord
149
+ ? changeRecord.iterable
150
+ : changeRecord);
151
151
}, collection: true );
152
152
} else if (_expression != null ) {
153
153
_watch = _scope.watch (_expression, onChange);
@@ -195,16 +195,15 @@ class NgModel extends NgControl implements AttachAware {
195
195
196
196
get viewValue => _viewValue;
197
197
void set viewValue (value) {
198
- //delay set
199
- _viewValue = value;
198
+ _viewValue = value;
200
199
modelValue = value;
201
200
}
202
201
203
202
get modelValue => _modelValue;
204
203
void set modelValue (value) {
205
204
try {
206
205
value = converter.parse (value);
207
- } catch (e) {
206
+ } catch (e) {
208
207
value = null ;
209
208
}
210
209
_modelValue = value;
@@ -305,10 +304,10 @@ class InputCheckbox {
305
304
});
306
305
};
307
306
inputElement
308
- ..onChange.listen ((_)=> ngModelOptions.executeChangeFunc (() {
307
+ ..onChange.listen ((_) => ngModelOptions.executeChangeFunc (() {
309
308
ngModel.viewValue = inputElement.checked ? ngTrueValue.value : ngFalseValue.value;
310
309
}))
311
- ..onBlur.listen ((_)=> ngModelOptions.executeBlurFunc (() {
310
+ ..onBlur.listen ((_) => ngModelOptions.executeBlurFunc (() {
312
311
ngModel.markAsTouched ();
313
312
}));
314
313
}
@@ -579,12 +578,18 @@ class NgBindTypeForDateLike {
579
578
* dropped.
580
579
*/
581
580
582
- @Decorator (selector: 'input[type=date][ng-model]' , module: InputDateLike .moduleFactory)
583
- @Decorator (selector: 'input[type=time][ng-model]' , module: InputDateLike .moduleFactory)
584
- @Decorator (selector: 'input[type=datetime][ng-model]' , module: InputDateLike .moduleFactory)
585
- @Decorator (selector: 'input[type=datetime-local][ng-model]' , module: InputDateLike .moduleFactory)
586
- @Decorator (selector: 'input[type=month][ng-model]' , module: InputDateLike .moduleFactory)
587
- @Decorator (selector: 'input[type=week][ng-model]' , module: InputDateLike .moduleFactory)
581
+ @Decorator (selector: 'input[type=date][ng-model]' ,
582
+ module: InputDateLike .moduleFactory)
583
+ @Decorator (selector: 'input[type=time][ng-model]' ,
584
+ module: InputDateLike .moduleFactory)
585
+ @Decorator (selector: 'input[type=datetime][ng-model]' ,
586
+ module: InputDateLike .moduleFactory)
587
+ @Decorator (selector: 'input[type=datetime-local][ng-model]' ,
588
+ module: InputDateLike .moduleFactory)
589
+ @Decorator (selector: 'input[type=month][ng-model]' ,
590
+ module: InputDateLike .moduleFactory)
591
+ @Decorator (selector: 'input[type=week][ng-model]' ,
592
+ module: InputDateLike .moduleFactory)
588
593
class InputDateLike {
589
594
static Module moduleFactory () => new Module ()..factory (NgBindTypeForDateLike ,
590
595
(Injector i) => new NgBindTypeForDateLike (i.get (dom.Element )));
@@ -607,7 +612,7 @@ class InputDateLike {
607
612
inputElement
608
613
..onChange.listen ((event) => ngModelOptions.executeChangeFunc (() => processValue ()))
609
614
..onInput.listen ((event) => ngModelOptions.executeInputFunc (() => processValue ()))
610
- ..onBlur.listen ((_)=> ngModelOptions.executeBlurFunc (() => () {
615
+ ..onBlur.listen ((_) => ngModelOptions.executeBlurFunc (() => () {
611
616
ngModel.markAsTouched ();
612
617
}));
613
618
}
0 commit comments