Skip to content
This repository was archived by the owner on Feb 22, 2018. It is now read-only.

Commit 308d8dc

Browse files
committed
Fixed some formatting
1 parent 68e21a6 commit 308d8dc

File tree

2 files changed

+23
-18
lines changed

2 files changed

+23
-18
lines changed

lib/directive/ng_model.dart

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,9 @@ class NgModel extends NgControl implements AttachAware {
145145
if (_watch!=null) _watch.remove();
146146
if (_watchCollection) {
147147
_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);
151151
}, collection: true);
152152
} else if (_expression != null) {
153153
_watch = _scope.watch(_expression, onChange);
@@ -195,16 +195,15 @@ class NgModel extends NgControl implements AttachAware {
195195

196196
get viewValue => _viewValue;
197197
void set viewValue(value) {
198-
//delay set
199-
_viewValue = value;
198+
_viewValue = value;
200199
modelValue = value;
201200
}
202201

203202
get modelValue => _modelValue;
204203
void set modelValue(value) {
205204
try {
206205
value = converter.parse(value);
207-
} catch (e) {
206+
} catch(e) {
208207
value = null;
209208
}
210209
_modelValue = value;
@@ -305,10 +304,10 @@ class InputCheckbox {
305304
});
306305
};
307306
inputElement
308-
..onChange.listen((_)=>ngModelOptions.executeChangeFunc(() {
307+
..onChange.listen((_) => ngModelOptions.executeChangeFunc(() {
309308
ngModel.viewValue = inputElement.checked ? ngTrueValue.value : ngFalseValue.value;
310309
}))
311-
..onBlur.listen((_)=>ngModelOptions.executeBlurFunc(() {
310+
..onBlur.listen((_) => ngModelOptions.executeBlurFunc(() {
312311
ngModel.markAsTouched();
313312
}));
314313
}
@@ -579,12 +578,18 @@ class NgBindTypeForDateLike {
579578
* dropped.
580579
*/
581580

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)
588593
class InputDateLike {
589594
static Module moduleFactory() => new Module()..factory(NgBindTypeForDateLike,
590595
(Injector i) => new NgBindTypeForDateLike(i.get(dom.Element)));
@@ -607,7 +612,7 @@ class InputDateLike {
607612
inputElement
608613
..onChange.listen((event) => ngModelOptions.executeChangeFunc(() => processValue()))
609614
..onInput.listen((event) => ngModelOptions.executeInputFunc(() => processValue()))
610-
..onBlur.listen((_)=> ngModelOptions.executeBlurFunc(() => () {
615+
..onBlur.listen((_) => ngModelOptions.executeBlurFunc(() => () {
611616
ngModel.markAsTouched();
612617
}));
613618
}

lib/directive/ng_model_options.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ part of angular.directive;
33
@Decorator(selector: 'input[ng-model-options]')
44
class NgModelOptions {
55
int _debounceDefaultValue = 0;
6-
int _debounceBlurValue = null;
7-
int _debounceChangeValue = null;
8-
int _debounceInputValue = null;
6+
int _debounceBlurValue;
7+
int _debounceChangeValue;
8+
int _debounceInputValue;
99

1010
static const String _DEBOUNCE_DEFAULT_KEY = "default";
1111
static const String _DEBOUNCE_BLUR_KEY = "blur";

0 commit comments

Comments
 (0)