fix(forms): export AbstractFormGroupDirective

Because
- `Form` is **exported** -- see line 30/31 of
`modules/@angular/forms/src/forms.ts`: i.e., <br>`export {Form} from
'./directives/form_interface'`; and
- Methods of `Form`, which are public, have an
`AbstractFormGroupDirective` parameter;
e.g.,<br>`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.**
This commit is contained in:
Patrice Chalin 2016-07-07 20:14:42 -07:00 committed by Alex Rickabaugh
parent 422d380b3e
commit 6195a45ae2
3 changed files with 18 additions and 3 deletions

View File

@ -15,10 +15,13 @@ import {Form} from './form_interface';
import {composeAsyncValidators, composeValidators, controlPath} from './shared'; import {composeAsyncValidators, composeValidators, controlPath} from './shared';
import {AsyncValidatorFn, ValidatorFn} from './validators'; 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 { export class AbstractFormGroupDirective extends ControlContainer implements OnInit, OnDestroy {
/** @internal */ /** @internal */
_parent: ControlContainer; _parent: ControlContainer;

View File

@ -23,6 +23,7 @@
export {FORM_DIRECTIVES, REACTIVE_FORM_DIRECTIVES} from './directives'; export {FORM_DIRECTIVES, REACTIVE_FORM_DIRECTIVES} from './directives';
export {AbstractControlDirective} from './directives/abstract_control_directive'; export {AbstractControlDirective} from './directives/abstract_control_directive';
export {AbstractFormGroupDirective} from './directives/abstract_form_group_directive';
export {CheckboxControlValueAccessor} from './directives/checkbox_value_accessor'; export {CheckboxControlValueAccessor} from './directives/checkbox_value_accessor';
export {ControlContainer} from './directives/control_container'; export {ControlContainer} from './directives/control_container';
export {ControlValueAccessor, NG_VALUE_ACCESSOR} from './directives/control_value_accessor'; export {ControlValueAccessor, NG_VALUE_ACCESSOR} from './directives/control_value_accessor';

View File

@ -75,6 +75,17 @@ export declare abstract class AbstractControlDirective {
reset(value?: any): void; 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 */ /** @experimental */
export interface AsyncValidatorFn { export interface AsyncValidatorFn {
(c: AbstractControl): any; (c: AbstractControl): any;