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 // https://github.com/angular/angular/issues/3011 is implemented
// selector: '[ngControl],[ngModel],[ngFormControl]', // selector: '[ngControl],[ngModel],[ngFormControl]',
host: {'(input)': 'onChange($event.target.value)', '(blur)': 'onTouched()'}, host: {'(input)': 'onChange($event.target.value)', '(blur)': 'onTouched()'},
bindings: [DEFAULT_VALUE_ACCESSOR] providers: [DEFAULT_VALUE_ACCESSOR]
}) })
export class DefaultValueAccessor implements ControlValueAccessor { export class DefaultValueAccessor implements ControlValueAccessor {
onChange = (_: any) => {}; onChange = (_: any) => {};

View File

@ -90,7 +90,7 @@ export const controlNameBinding: any =
*/ */
@Directive({ @Directive({
selector: '[ngControl]', selector: '[ngControl]',
bindings: [controlNameBinding], providers: [controlNameBinding],
inputs: ['name: ngControl', 'model: ngModel'], inputs: ['name: ngControl', 'model: ngModel'],
outputs: ['update: ngModelChange'], outputs: ['update: ngModelChange'],
exportAs: 'ngForm' exportAs: 'ngForm'

View File

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

View File

@ -79,7 +79,7 @@ export const formControlBinding: any =
*/ */
@Directive({ @Directive({
selector: '[ngFormControl]', selector: '[ngFormControl]',
bindings: [formControlBinding], providers: [formControlBinding],
inputs: ['form: ngFormControl', 'model: ngModel'], inputs: ['form: ngFormControl', 'model: ngModel'],
outputs: ['update: ngModelChange'], outputs: ['update: ngModelChange'],
exportAs: 'ngForm' exportAs: 'ngForm'

View File

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

View File

@ -50,7 +50,7 @@ export const formControlBinding: any =
*/ */
@Directive({ @Directive({
selector: '[ngModel]:not([ngControl]):not([ngFormControl])', selector: '[ngModel]:not([ngControl]):not([ngFormControl])',
bindings: [formControlBinding], providers: [formControlBinding],
inputs: ['model: ngModel'], inputs: ['model: ngModel'],
outputs: ['update: ngModelChange'], outputs: ['update: ngModelChange'],
exportAs: 'ngForm' exportAs: 'ngForm'

View File

@ -25,7 +25,7 @@ export const NUMBER_VALUE_ACCESSOR: any = /*@ts2dart_const*/ /*@ts2dart_Provider
'(input)': 'onChange($event.target.value)', '(input)': 'onChange($event.target.value)',
'(blur)': 'onTouched()' '(blur)': 'onTouched()'
}, },
bindings: [NUMBER_VALUE_ACCESSOR] providers: [NUMBER_VALUE_ACCESSOR]
}) })
export class NumberValueAccessor implements ControlValueAccessor { export class NumberValueAccessor implements ControlValueAccessor {
onChange = (_: any) => {}; onChange = (_: any) => {};

View File

@ -1,5 +1,4 @@
import {OpaqueToken} from '@angular/core'; import {OpaqueToken} from '@angular/core';
import {isBlank, isPresent, isString} from '../../src/facade/lang'; import {isBlank, isPresent, isString} from '../../src/facade/lang';
import {PromiseWrapper} from '../../src/facade/promise'; import {PromiseWrapper} from '../../src/facade/promise';
import {ObservableWrapper} from '../../src/facade/async'; import {ObservableWrapper} from '../../src/facade/async';