feat(forms): export validator directives as part of formDirectives

This commit is contained in:
vsavkin 2015-06-05 14:31:03 -07:00
parent 5fc23caef7
commit 73bce40287
2 changed files with 6 additions and 3 deletions

View File

@ -8,6 +8,7 @@ import {TemplateDrivenFormDirective} from './directives/template_driven_form_dir
import {DefaultValueAccessor} from './directives/default_value_accessor';
import {CheckboxControlValueAccessor} from './directives/checkbox_value_accessor';
import {SelectControlValueAccessor} from './directives/select_control_value_accessor';
import {RequiredValidatorDirective} from './validator_directives';
export {ControlNameDirective} from './directives/control_name_directive';
export {FormControlDirective} from './directives/form_control_directive';
@ -20,6 +21,7 @@ export {ControlValueAccessor} from './directives/control_value_accessor';
export {DefaultValueAccessor} from './directives/default_value_accessor';
export {CheckboxControlValueAccessor} from './directives/checkbox_value_accessor';
export {SelectControlValueAccessor} from './directives/select_control_value_accessor';
export {RequiredValidatorDirective} from './validator_directives';
/**
*
@ -40,5 +42,7 @@ export const formDirectives: List<Type> = CONST_EXPR([
DefaultValueAccessor,
CheckboxControlValueAccessor,
SelectControlValueAccessor
SelectControlValueAccessor,
RequiredValidatorDirective
]);

View File

@ -24,7 +24,6 @@ import {NgIf} from 'angular2/directives';
import {
Control,
ControlGroup,
RequiredValidatorDirective,
TemplateDrivenFormDirective,
formDirectives,
Validators,
@ -752,7 +751,7 @@ class WrappedValue implements ControlValueAccessor {
}
@Component({selector: "my-comp"})
@View({directives: [formDirectives, WrappedValue, RequiredValidatorDirective, NgIf]})
@View({directives: [formDirectives, WrappedValue, NgIf]})
class MyComp {
form: any;
name: string;