1 | /**
|
---|
2 | * @license
|
---|
3 | * Copyright Google LLC All Rights Reserved.
|
---|
4 | *
|
---|
5 | * Use of this source code is governed by an MIT-style license that can be
|
---|
6 | * found in the LICENSE file at https://angular.io/license
|
---|
7 | */
|
---|
8 | import { NgModule } from '@angular/core';
|
---|
9 | import { InternalFormsSharedModule, NG_MODEL_WITH_FORM_CONTROL_WARNING, REACTIVE_DRIVEN_DIRECTIVES, TEMPLATE_DRIVEN_DIRECTIVES } from './directives';
|
---|
10 | /**
|
---|
11 | * Exports the required providers and directives for template-driven forms,
|
---|
12 | * making them available for import by NgModules that import this module.
|
---|
13 | *
|
---|
14 | * Providers associated with this module:
|
---|
15 | * * `RadioControlRegistry`
|
---|
16 | *
|
---|
17 | * @see [Forms Overview](/guide/forms-overview)
|
---|
18 | * @see [Template-driven Forms Guide](/guide/forms)
|
---|
19 | *
|
---|
20 | * @publicApi
|
---|
21 | */
|
---|
22 | export class FormsModule {
|
---|
23 | }
|
---|
24 | FormsModule.decorators = [
|
---|
25 | { type: NgModule, args: [{
|
---|
26 | declarations: TEMPLATE_DRIVEN_DIRECTIVES,
|
---|
27 | exports: [InternalFormsSharedModule, TEMPLATE_DRIVEN_DIRECTIVES]
|
---|
28 | },] }
|
---|
29 | ];
|
---|
30 | /**
|
---|
31 | * Exports the required infrastructure and directives for reactive forms,
|
---|
32 | * making them available for import by NgModules that import this module.
|
---|
33 | *
|
---|
34 | * Providers associated with this module:
|
---|
35 | * * `FormBuilder`
|
---|
36 | * * `RadioControlRegistry`
|
---|
37 | *
|
---|
38 | * @see [Forms Overview](guide/forms-overview)
|
---|
39 | * @see [Reactive Forms Guide](guide/reactive-forms)
|
---|
40 | *
|
---|
41 | * @publicApi
|
---|
42 | */
|
---|
43 | export class ReactiveFormsModule {
|
---|
44 | /**
|
---|
45 | * @description
|
---|
46 | * Provides options for configuring the reactive forms module.
|
---|
47 | *
|
---|
48 | * @param opts An object of configuration options
|
---|
49 | * * `warnOnNgModelWithFormControl` Configures when to emit a warning when an `ngModel`
|
---|
50 | * binding is used with reactive form directives.
|
---|
51 | */
|
---|
52 | static withConfig(opts) {
|
---|
53 | return {
|
---|
54 | ngModule: ReactiveFormsModule,
|
---|
55 | providers: [
|
---|
56 | { provide: NG_MODEL_WITH_FORM_CONTROL_WARNING, useValue: opts.warnOnNgModelWithFormControl }
|
---|
57 | ]
|
---|
58 | };
|
---|
59 | }
|
---|
60 | }
|
---|
61 | ReactiveFormsModule.decorators = [
|
---|
62 | { type: NgModule, args: [{
|
---|
63 | declarations: [REACTIVE_DRIVEN_DIRECTIVES],
|
---|
64 | exports: [InternalFormsSharedModule, REACTIVE_DRIVEN_DIRECTIVES]
|
---|
65 | },] }
|
---|
66 | ];
|
---|
67 | //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZm9ybV9wcm92aWRlcnMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9wYWNrYWdlcy9mb3Jtcy9zcmMvZm9ybV9wcm92aWRlcnMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7OztHQU1HO0FBRUgsT0FBTyxFQUFzQixRQUFRLEVBQUMsTUFBTSxlQUFlLENBQUM7QUFFNUQsT0FBTyxFQUFDLHlCQUF5QixFQUFFLGtDQUFrQyxFQUFFLDBCQUEwQixFQUFFLDBCQUEwQixFQUFDLE1BQU0sY0FBYyxDQUFDO0FBRW5KOzs7Ozs7Ozs7OztHQVdHO0FBS0gsTUFBTSxPQUFPLFdBQVc7OztZQUp2QixRQUFRLFNBQUM7Z0JBQ1IsWUFBWSxFQUFFLDBCQUEwQjtnQkFDeEMsT0FBTyxFQUFFLENBQUMseUJBQXlCLEVBQUUsMEJBQTBCLENBQUM7YUFDakU7O0FBSUQ7Ozs7Ozs7Ozs7OztHQVlHO0FBS0gsTUFBTSxPQUFPLG1CQUFtQjtJQUM5Qjs7Ozs7OztPQU9H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