From 6195a45ae2b1a187527a10c0b2982220c40148ba Mon Sep 17 00:00:00 2001 From: Patrice Chalin Date: Thu, 7 Jul 2016 20:14:42 -0700 Subject: [PATCH] fix(forms): export AbstractFormGroupDirective Because - `Form` is **exported** -- see line 30/31 of `modules/@angular/forms/src/forms.ts`: i.e.,
`export {Form} from './directives/form_interface'`; and - Methods of `Form`, which are public, have an `AbstractFormGroupDirective` parameter; e.g.,
`Form.getFormGroup(dir: AbstractFormGroupDirective): FormGroup`. Then it makes sense for `AbstractFormGroupDirective` to be public/exported too. In any case, if it isn't exported then the **API docs for `Form` don't get generated properly.** --- .../src/directives/abstract_form_group_directive.ts | 9 ++++++--- modules/@angular/forms/src/forms.ts | 1 + tools/public_api_guard/forms/index.d.ts | 11 +++++++++++ 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/modules/@angular/forms/src/directives/abstract_form_group_directive.ts b/modules/@angular/forms/src/directives/abstract_form_group_directive.ts index ab5dedeac2..1b4a464f95 100644 --- a/modules/@angular/forms/src/directives/abstract_form_group_directive.ts +++ b/modules/@angular/forms/src/directives/abstract_form_group_directive.ts @@ -15,10 +15,13 @@ import {Form} from './form_interface'; import {composeAsyncValidators, composeValidators, controlPath} from './shared'; import {AsyncValidatorFn, ValidatorFn} from './validators'; -/** - This is a base class for code shared between {@link NgModelGroup} and {@link FormGroupName}. - */ + +/** + * This is a base class for code shared between {@link NgModelGroup} and {@link FormGroupName}. + * + * @experimental + */ export class AbstractFormGroupDirective extends ControlContainer implements OnInit, OnDestroy { /** @internal */ _parent: ControlContainer; diff --git a/modules/@angular/forms/src/forms.ts b/modules/@angular/forms/src/forms.ts index e0c9b1f5c9..eb975f8bab 100644 --- a/modules/@angular/forms/src/forms.ts +++ b/modules/@angular/forms/src/forms.ts @@ -23,6 +23,7 @@ export {FORM_DIRECTIVES, REACTIVE_FORM_DIRECTIVES} from './directives'; export {AbstractControlDirective} from './directives/abstract_control_directive'; +export {AbstractFormGroupDirective} from './directives/abstract_form_group_directive'; export {CheckboxControlValueAccessor} from './directives/checkbox_value_accessor'; export {ControlContainer} from './directives/control_container'; export {ControlValueAccessor, NG_VALUE_ACCESSOR} from './directives/control_value_accessor'; diff --git a/tools/public_api_guard/forms/index.d.ts b/tools/public_api_guard/forms/index.d.ts index 4ebe30b38c..e56ff92f00 100644 --- a/tools/public_api_guard/forms/index.d.ts +++ b/tools/public_api_guard/forms/index.d.ts @@ -75,6 +75,17 @@ export declare abstract class AbstractControlDirective { reset(value?: any): void; } +/** @experimental */ +export declare class AbstractFormGroupDirective extends ControlContainer implements OnInit, OnDestroy { + asyncValidator: AsyncValidatorFn; + control: FormGroup; + formDirective: Form; + path: string[]; + validator: ValidatorFn; + ngOnDestroy(): void; + ngOnInit(): void; +} + /** @experimental */ export interface AsyncValidatorFn { (c: AbstractControl): any;