import { EventEmitter } from '../facade/async'; import { AbstractControl, FormControl, FormGroup } from '../model'; import { ControlContainer } from './control_container'; import { Form } from './form_interface'; import { NgControl } from './ng_control'; import { NgModel } from './ng_model'; import { NgModelGroup } from './ng_model_group'; export declare const formDirectiveProvider: any; /** * If `NgForm` is bound in a component, `
` elements in that component will be * upgraded to use the Angular form system. * * ### Typical Use * * Include `FORM_DIRECTIVES` in the `directives` section of a {@link View} annotation * to use `NgForm` and its associated controls. * * ### Structure * * An Angular form is a collection of `FormControl`s in some hierarchy. * `FormControl`s can be at the top level or can be organized in `FormGroup`s * or `FormArray`s. This hierarchy is reflected in the form's `value`, a * JSON object that mirrors the form structure. * * ### Submission * * The `ngSubmit` event signals when the user triggers a form submission. * * ```typescript * @Component({ * selector: 'my-app', * template: ` *
*

Submit the form to see the data object Angular builds

*

NgForm demo

* *

Control group: credentials

*
*

Login:

*

Password:

*
*

Control group: person

*
*

First name:

*

Last name:

*
* *

Form data submitted:

* *
{{data}}
*
* `, * directives: [] * }) * export class App { * constructor() {} * * data: string; * * onSubmit(data) { * this.data = JSON.stringify(data, null, 2); * } * } * ``` * * @experimental */ export declare class NgForm extends ControlContainer implements Form { private _submitted; form: FormGroup; ngSubmit: EventEmitter<{}>; constructor(validators: any[], asyncValidators: any[]); submitted: boolean; formDirective: Form; control: FormGroup; path: string[]; controls: { [key: string]: AbstractControl; }; addControl(dir: NgModel): void; getControl(dir: NgModel): FormControl; removeControl(dir: NgModel): void; addFormGroup(dir: NgModelGroup): void; removeFormGroup(dir: NgModelGroup): void; getFormGroup(dir: NgModelGroup): FormGroup; updateModel(dir: NgControl, value: any): void; onSubmit(): boolean; }