refactor(forms): remove useless imports
Remove useless imports and change `bindings` to `providers` inside `@Component` and `@Directive`. Closes #7904
This commit is contained in:
parent
33c7f74cb9
commit
165357bfa3
@ -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) => {};
|
||||||
|
@ -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'
|
||||||
|
@ -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()',
|
||||||
},
|
},
|
||||||
|
@ -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'
|
||||||
|
@ -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'],
|
||||||
|
@ -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'
|
||||||
|
@ -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) => {};
|
||||||
|
@ -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';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user