/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import {Directive, Inject, Optional, Self, forwardRef} from '@angular/core'; import {EventEmitter} from '../facade/async'; import {AbstractControl, FormControl, FormGroup} from '../model'; import {NG_ASYNC_VALIDATORS, NG_VALIDATORS} from '../validators'; 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'; import {composeAsyncValidators, composeValidators, setUpControl, setUpFormContainer} from './shared'; export const formDirectiveProvider: any = { provide: ControlContainer, useExisting: forwardRef(() => NgForm) }; const resolvedPromise = Promise.resolve(null); /** * @whatItDoes Creates a top-level {@link FormGroup} instance and binds it to a form * to track aggregate form value and validation status. * * @howToUse * * As soon as you import the `FormsModule`, this directive becomes active by default on * all `