refactor(forms): remove useless imports

Remove useless imports and change `bindings` to `providers` inside
`@Component` and `@Directive`.

Closes #7904
This commit is contained in:
mgechev 2016-04-04 16:04:30 +03:00 committed by Misko Hevery
parent 33c7f74cb9
commit 165357bfa3
8 changed files with 7 additions and 8 deletions

View File

@ -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) => {};

View File

@ -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'

View File

@ -78,7 +78,7 @@ export const formDirectiveProvider: any =
*/
@Directive({
selector: 'form:not([ngNoForm]):not([ngFormModel]),ngForm,[ngForm]',
bindings: [formDirectiveProvider],
providers: [formDirectiveProvider],
host: {
'(submit)': 'onSubmit()',
},

View File

@ -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'

View File

@ -99,7 +99,7 @@ export const formDirectiveProvider: any =
*/
@Directive({
selector: '[ngFormModel]',
bindings: [formDirectiveProvider],
providers: [formDirectiveProvider],
inputs: ['form: ngFormModel'],
host: {'(submit)': 'onSubmit()'},
outputs: ['ngSubmit'],

View File

@ -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'

View File

@ -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) => {};

View File

@ -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';