From 165357bfa32f142e18d2543cebffbc1113796171 Mon Sep 17 00:00:00 2001 From: mgechev Date: Mon, 4 Apr 2016 16:04:30 +0300 Subject: [PATCH] refactor(forms): remove useless imports Remove useless imports and change `bindings` to `providers` inside `@Component` and `@Directive`. Closes #7904 --- .../common/src/forms/directives/default_value_accessor.ts | 2 +- modules/@angular/common/src/forms/directives/ng_control_name.ts | 2 +- modules/@angular/common/src/forms/directives/ng_form.ts | 2 +- modules/@angular/common/src/forms/directives/ng_form_control.ts | 2 +- modules/@angular/common/src/forms/directives/ng_form_model.ts | 2 +- modules/@angular/common/src/forms/directives/ng_model.ts | 2 +- .../common/src/forms/directives/number_value_accessor.ts | 2 +- modules/@angular/common/src/forms/validators.ts | 1 - 8 files changed, 7 insertions(+), 8 deletions(-) diff --git a/modules/@angular/common/src/forms/directives/default_value_accessor.ts b/modules/@angular/common/src/forms/directives/default_value_accessor.ts index 7c64fe28e8..ad2c45be41 100644 --- a/modules/@angular/common/src/forms/directives/default_value_accessor.ts +++ b/modules/@angular/common/src/forms/directives/default_value_accessor.ts @@ -25,7 +25,7 @@ export const DEFAULT_VALUE_ACCESSOR: any = /*@ts2dart_const*/ // https://github.com/angular/angular/issues/3011 is implemented // selector: '[ngControl],[ngModel],[ngFormControl]', host: {'(input)': 'onChange($event.target.value)', '(blur)': 'onTouched()'}, - bindings: [DEFAULT_VALUE_ACCESSOR] + providers: [DEFAULT_VALUE_ACCESSOR] }) export class DefaultValueAccessor implements ControlValueAccessor { onChange = (_: any) => {}; diff --git a/modules/@angular/common/src/forms/directives/ng_control_name.ts b/modules/@angular/common/src/forms/directives/ng_control_name.ts index 240b4d93ba..93fa3f6058 100644 --- a/modules/@angular/common/src/forms/directives/ng_control_name.ts +++ b/modules/@angular/common/src/forms/directives/ng_control_name.ts @@ -90,7 +90,7 @@ export const controlNameBinding: any = */ @Directive({ selector: '[ngControl]', - bindings: [controlNameBinding], + providers: [controlNameBinding], inputs: ['name: ngControl', 'model: ngModel'], outputs: ['update: ngModelChange'], exportAs: 'ngForm' diff --git a/modules/@angular/common/src/forms/directives/ng_form.ts b/modules/@angular/common/src/forms/directives/ng_form.ts index b90b519f46..704d9178b1 100644 --- a/modules/@angular/common/src/forms/directives/ng_form.ts +++ b/modules/@angular/common/src/forms/directives/ng_form.ts @@ -78,7 +78,7 @@ export const formDirectiveProvider: any = */ @Directive({ selector: 'form:not([ngNoForm]):not([ngFormModel]),ngForm,[ngForm]', - bindings: [formDirectiveProvider], + providers: [formDirectiveProvider], host: { '(submit)': 'onSubmit()', }, diff --git a/modules/@angular/common/src/forms/directives/ng_form_control.ts b/modules/@angular/common/src/forms/directives/ng_form_control.ts index 4c0fc86d20..0ec1598396 100644 --- a/modules/@angular/common/src/forms/directives/ng_form_control.ts +++ b/modules/@angular/common/src/forms/directives/ng_form_control.ts @@ -79,7 +79,7 @@ export const formControlBinding: any = */ @Directive({ selector: '[ngFormControl]', - bindings: [formControlBinding], + providers: [formControlBinding], inputs: ['form: ngFormControl', 'model: ngModel'], outputs: ['update: ngModelChange'], exportAs: 'ngForm' diff --git a/modules/@angular/common/src/forms/directives/ng_form_model.ts b/modules/@angular/common/src/forms/directives/ng_form_model.ts index 373000f6ab..6924a85b90 100644 --- a/modules/@angular/common/src/forms/directives/ng_form_model.ts +++ b/modules/@angular/common/src/forms/directives/ng_form_model.ts @@ -99,7 +99,7 @@ export const formDirectiveProvider: any = */ @Directive({ selector: '[ngFormModel]', - bindings: [formDirectiveProvider], + providers: [formDirectiveProvider], inputs: ['form: ngFormModel'], host: {'(submit)': 'onSubmit()'}, outputs: ['ngSubmit'], diff --git a/modules/@angular/common/src/forms/directives/ng_model.ts b/modules/@angular/common/src/forms/directives/ng_model.ts index 47591f8200..accf55a2ef 100644 --- a/modules/@angular/common/src/forms/directives/ng_model.ts +++ b/modules/@angular/common/src/forms/directives/ng_model.ts @@ -50,7 +50,7 @@ export const formControlBinding: any = */ @Directive({ selector: '[ngModel]:not([ngControl]):not([ngFormControl])', - bindings: [formControlBinding], + providers: [formControlBinding], inputs: ['model: ngModel'], outputs: ['update: ngModelChange'], exportAs: 'ngForm' diff --git a/modules/@angular/common/src/forms/directives/number_value_accessor.ts b/modules/@angular/common/src/forms/directives/number_value_accessor.ts index 7f3b731d68..dd9aa40753 100644 --- a/modules/@angular/common/src/forms/directives/number_value_accessor.ts +++ b/modules/@angular/common/src/forms/directives/number_value_accessor.ts @@ -25,7 +25,7 @@ export const NUMBER_VALUE_ACCESSOR: any = /*@ts2dart_const*/ /*@ts2dart_Provider '(input)': 'onChange($event.target.value)', '(blur)': 'onTouched()' }, - bindings: [NUMBER_VALUE_ACCESSOR] + providers: [NUMBER_VALUE_ACCESSOR] }) export class NumberValueAccessor implements ControlValueAccessor { onChange = (_: any) => {}; diff --git a/modules/@angular/common/src/forms/validators.ts b/modules/@angular/common/src/forms/validators.ts index 5498617acc..62990e8780 100644 --- a/modules/@angular/common/src/forms/validators.ts +++ b/modules/@angular/common/src/forms/validators.ts @@ -1,5 +1,4 @@ import {OpaqueToken} from '@angular/core'; - import {isBlank, isPresent, isString} from '../../src/facade/lang'; import {PromiseWrapper} from '../../src/facade/promise'; import {ObservableWrapper} from '../../src/facade/async';