From 73bce4028766c3b4252e89a1bf4fdf0f547eb8f4 Mon Sep 17 00:00:00 2001 From: vsavkin Date: Fri, 5 Jun 2015 14:31:03 -0700 Subject: [PATCH] feat(forms): export validator directives as part of formDirectives --- modules/angular2/src/forms/directives.ts | 6 +++++- modules/angular2/test/forms/integration_spec.ts | 3 +-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/modules/angular2/src/forms/directives.ts b/modules/angular2/src/forms/directives.ts index f19b94c0a7..4c4fafeb95 100644 --- a/modules/angular2/src/forms/directives.ts +++ b/modules/angular2/src/forms/directives.ts @@ -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 = CONST_EXPR([ DefaultValueAccessor, CheckboxControlValueAccessor, - SelectControlValueAccessor + SelectControlValueAccessor, + + RequiredValidatorDirective ]); \ No newline at end of file diff --git a/modules/angular2/test/forms/integration_spec.ts b/modules/angular2/test/forms/integration_spec.ts index 8e85898bbb..008d9e7412 100644 --- a/modules/angular2/test/forms/integration_spec.ts +++ b/modules/angular2/test/forms/integration_spec.ts @@ -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;