/** * @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 {ListWrapper} from '../facade/collection'; import {isPresent} from '../facade/lang'; 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); /** * If `NgForm` is bound in a component, `