-
Notifications
You must be signed in to change notification settings - Fork 366
/
app.module.ts
106 lines (99 loc) · 4.16 KB
/
app.module.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
import { NgModule } from "@angular/core";
import { Http, BaseRequestOptions } from "@angular/http";
import { MatCardModule, MatNativeDateModule, MATERIAL_COMPATIBILITY_MODE } from "@angular/material";
import { MockBackend } from "@angular/http/testing";
import { BrowserModule } from "@angular/platform-browser";
import { BrowserAnimationsModule } from "@angular/platform-browser/animations";
import { LocationStrategy, HashLocationStrategy } from "@angular/common";
import { ReactiveFormsModule, NG_VALIDATORS, NG_ASYNC_VALIDATORS } from "@angular/forms";
import { NgbDatepickerModule, NgbTimepickerModule } from "@ng-bootstrap/ng-bootstrap";
//import { BsDatepickerModule } from "ngx-bootstrap";
import { DynamicFormsCoreModule } from "@ng-dynamic-forms/core";
import { DynamicFormsBasicUIModule } from "@ng-dynamic-forms/ui-basic";
import { DynamicFormsBootstrapUIModule } from "@ng-dynamic-forms/ui-bootstrap";
import { DynamicFormsFoundationUIModule } from "@ng-dynamic-forms/ui-foundation";
import { DynamicFormsKendoUIModule } from "@ng-dynamic-forms/ui-kendo";
import { DynamicFormsMaterialUIModule } from "@ng-dynamic-forms/ui-material";
import { DynamicFormsNGBootstrapUIModule } from "@ng-dynamic-forms/ui-ng-bootstrap";
import { DynamicFormsPrimeNGUIModule } from "@ng-dynamic-forms/ui-primeng";
import { BasicSampleFormComponent } from "./ui-basic/basic-sample-form.component";
import { BootstrapSampleFormComponent } from "./ui-bootstrap/bootstrap-sample-form.component";
import { FoundationSampleFormComponent } from "./ui-foundation/foundation-sample-form.component";
import { KendoSampleFormComponent } from "./ui-kendo/kendo-sample-form.component";
import { MaterialSampleFormComponent } from "./ui-material/material-sample-form.component";
import { NGBootstrapSampleFormComponent } from "./ui-ng-bootstrap/ng-bootstrap-sample-form.component";
import { PrimeNGSampleFormComponent } from "./ui-primeng/primeng-sample-form.component";
import { ValidationMessageComponent } from "./validation-message/validation-message.component";
import { AppRoutingModule } from './app.routing.module';
import { AppComponent } from './app.component';
import { customValidator, customDateRangeValidator, customAsyncFormGroupValidator } from "./app.validators";
export function mockBackendFactory(mockBackend: MockBackend, baseRequestOptions: BaseRequestOptions) {
return new Http(mockBackend, baseRequestOptions);
}
@NgModule({
imports: [
BrowserModule,
BrowserAnimationsModule,
ReactiveFormsModule,
AppRoutingModule,
MatNativeDateModule,
MatCardModule,
NgbDatepickerModule.forRoot(),
NgbTimepickerModule.forRoot(),
//BsDatepickerModule.forRoot(),
DynamicFormsCoreModule.forRoot(),
DynamicFormsBasicUIModule,
DynamicFormsBootstrapUIModule,
DynamicFormsFoundationUIModule,
DynamicFormsKendoUIModule,
DynamicFormsMaterialUIModule,
DynamicFormsNGBootstrapUIModule,
DynamicFormsPrimeNGUIModule
],
declarations: [
BasicSampleFormComponent,
BootstrapSampleFormComponent,
FoundationSampleFormComponent,
KendoSampleFormComponent,
MaterialSampleFormComponent,
NGBootstrapSampleFormComponent,
PrimeNGSampleFormComponent,
ValidationMessageComponent,
AppComponent
],
providers: [
BaseRequestOptions,
MockBackend,
{
provide: Http,
deps: [MockBackend, BaseRequestOptions],
useFactory: mockBackendFactory
},
{
provide: LocationStrategy,
useClass: HashLocationStrategy
},
{
provide: NG_VALIDATORS,
useValue: customValidator,
multi: true
},
{
provide: NG_VALIDATORS,
useValue: customDateRangeValidator,
multi: true
},
{
provide: NG_ASYNC_VALIDATORS,
useValue: customAsyncFormGroupValidator,
multi: true
},
{
provide: MATERIAL_COMPATIBILITY_MODE,
useValue: true
}
],
bootstrap: [AppComponent]
})
export class AppModule {
}