/** * @license * Copyright Google LLC 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 { NgModule } from '@angular/core'; import { InternalFormsSharedModule, NG_MODEL_WITH_FORM_CONTROL_WARNING, REACTIVE_DRIVEN_DIRECTIVES, TEMPLATE_DRIVEN_DIRECTIVES } from './directives'; import { CALL_SET_DISABLED_STATE, setDisabledStateDefault } from './directives/shared'; import * as i0 from "@angular/core"; import * as i1 from "./directives/ng_model"; import * as i2 from "./directives/ng_model_group"; import * as i3 from "./directives/ng_form"; import * as i4 from "./directives/reactive_directives/form_control_directive"; import * as i5 from "./directives/reactive_directives/form_group_directive"; import * as i6 from "./directives/reactive_directives/form_control_name"; import * as i7 from "./directives/reactive_directives/form_group_name"; /** * Exports the required providers and directives for template-driven forms, * making them available for import by NgModules that import this module. * * Providers associated with this module: * * `RadioControlRegistry` * * @see [Forms Overview](/guide/forms-overview) * @see [Template-driven Forms Guide](/guide/forms) * * @publicApi */ export class FormsModule { /** * @description * Provides options for configuring the forms module. * * @param opts An object of configuration options * * `callSetDisabledState` Configures whether to `always` call `setDisabledState`, which is more * correct, or to only call it `whenDisabled`, which is the legacy behavior. */ static withConfig(opts) { return { ngModule: FormsModule, providers: [{ provide: CALL_SET_DISABLED_STATE, useValue: opts.callSetDisabledState ?? setDisabledStateDefault }] }; } static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FormsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); } static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: FormsModule, declarations: [i1.NgModel, i2.NgModelGroup, i3.NgForm], exports: [InternalFormsSharedModule, i1.NgModel, i2.NgModelGroup, i3.NgForm] }); } static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FormsModule, imports: [InternalFormsSharedModule] }); } } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FormsModule, decorators: [{ type: NgModule, args: [{ declarations: TEMPLATE_DRIVEN_DIRECTIVES, exports: [InternalFormsSharedModule, TEMPLATE_DRIVEN_DIRECTIVES] }] }] }); /** * Exports the required infrastructure and directives for reactive forms, * making them available for import by NgModules that import this module. * * Providers associated with this module: * * `RadioControlRegistry` * * @see [Forms Overview](guide/forms-overview) * @see [Reactive Forms Guide](guide/reactive-forms) * * @publicApi */ export class ReactiveFormsModule { /** * @description * Provides options for configuring the reactive forms module. * * @param opts An object of configuration options * * `warnOnNgModelWithFormControl` Configures when to emit a warning when an `ngModel` * binding is used with reactive form directives. * * `callSetDisabledState` Configures whether to `always` call `setDisabledState`, which is more * correct, or to only call it `whenDisabled`, which is the legacy behavior. */ static withConfig(opts) { return { ngModule: ReactiveFormsModule, providers: [ { provide: NG_MODEL_WITH_FORM_CONTROL_WARNING, useValue: opts.warnOnNgModelWithFormControl ?? 'always' }, { provide: CALL_SET_DISABLED_STATE, useValue: opts.callSetDisabledState ?? setDisabledStateDefault } ] }; } static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ReactiveFormsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); } static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: ReactiveFormsModule, declarations: [i4.FormControlDirective, i5.FormGroupDirective, i6.FormControlName, i7.FormGroupName, i7.FormArrayName], exports: [InternalFormsSharedModule, i4.FormControlDirective, i5.FormGroupDirective, i6.FormControlName, i7.FormGroupName, i7.FormArrayName] }); } static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ReactiveFormsModule, imports: [InternalFormsSharedModule] }); } } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ReactiveFormsModule, decorators: [{ type: NgModule, args: [{ declarations: [REACTIVE_DRIVEN_DIRECTIVES], exports: [InternalFormsSharedModule, REACTIVE_DRIVEN_DIRECTIVES] }] }] }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZm9ybV9wcm92aWRlcnMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9wYWNrYWdlcy9mb3Jtcy9zcmMvZm9ybV9wcm92aWRlcnMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7OztHQU1HO0FBRUgsT0FBTyxFQUFzQixRQUFRLEVBQUMsTUFBTSxlQUFlLENBQUM7QUFFNUQsT0FBTyxFQUFDLHlCQUF5QixFQUFFLGtDQUFrQyxFQUFFLDBCQUEwQixFQUFFLDBCQUEwQixFQUFDLE1BQU0sY0FBYyxDQUFDO0FBQ25KLE9BQU8sRUFBQyx1QkFBdUIsRUFBRSx1QkFBdUIsRUFBeUIsTUFBTSxxQkFBcUIsQ0FBQzs7Ozs7Ozs7O0FBRTdHOzs7Ozs7Ozs7OztHQVdHO0FBS0gsTUFBTSxPQUFPLFdBQVc7SUFDdEI7Ozs7Ozs7T0FPRztJQUNILE1BQU0sQ0FBQyxVQUFVLENBQUMsSUFFakI7UUFDQyxPQUFPO1lBQ0wsUUFBUSxFQUFFLFdBQVc7WUFDckIsU0FBUyxFQUFFLENBQUM7b0JBQ1YsT0FBTyxFQUFFLHVCQUF1QjtvQkFDaEMsUUFBUSxFQUFFLElBQUksQ0FBQyxvQkFBb0IsSUFBSSx1QkFBdUI7aUJBQy9ELENBQUM7U0FDSCxDQUFDO0lBQ0osQ0FBQzt5SEFuQlUsV0FBVzswSEFBWCxXQUFXLG9FQUZaLHlCQUF5QjswSEFFeEIsV0FBVyxZQUZaLHlCQUF5Qjs7c0dBRXhCLFdBQVc7a0JBSnZCLFFBQVE7bUJBQUM7b0JBQ1IsWUFBWSx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