argos/dmp-frontend/src/app/form/dynamic-form.module.ts

102 lines
4.1 KiB
TypeScript
Raw Normal View History

2018-01-30 10:35:26 +01:00
import { TranslateHttpLoader } from '@ngx-translate/http-loader';
import { PaginationService } from '../services/pagination.service';
2018-05-28 11:50:42 +02:00
import { VisibilityRulesService } from '../utilities/visibility-rules/visibility-rules.service';
2018-01-30 10:35:26 +01:00
import { DynamicFieldCheckBoxComponent } from './dynamic-fields/dynamic-field-checkbox/dynamic-field-checkbox';
import { ProgressBarComponent } from './pprogress-bar/progress-bar.component';
import { TableOfContentsFieldComponent } from './tableOfContents/table-of-content-field/table-of-content-field.component';
import { DynamicFormSectionComponent } from './dynamic-form-section/dynamic-form-section';
import { DynamicFieldDropdownComponent } from './dynamic-fields/dynamic-field-dropdown/dynamic-field-dropdown';
import { AutocompleteRemoteComponent } from './dynamic-fields/dynamic-field-autocomplete/autocomplete-remote.component';
import {
2018-05-28 11:50:42 +02:00
TableOfContentsSectionComponent,
2018-01-30 10:35:26 +01:00
} from './tableOfContents/table-of-content-section/table-of-content-section.component';
import { TableOfContentsGroupComponent } from './tableOfContents/table-of-content-group/table-of-content-group.component';
import {
2018-05-28 11:50:42 +02:00
TableOfContentsFieldSetComponent,
2018-01-30 10:35:26 +01:00
} from './tableOfContents/table-of-content-fieldset/table-of-content-fieldset.component';
import { DynamicFieldRadioBoxComponent } from './dynamic-fields/dynamic-field-radiobox/dynamic-field-radiobox.component';
import { TableOfContentsComponent } from './tableOfContents/table-of-contents.component';
import {
2018-05-28 11:50:42 +02:00
DynamicFieldBooleanDecisionComponent,
2018-01-30 10:35:26 +01:00
} from './dynamic-fields/dynamic-field-boolean-decision/dynamic-field-boolean-decision.component';
import { DynamicFormGroupComponent } from './dynamic-form-group/dynamic-form-group.component';
import { DynamicFormCompositeFieldComponent } from './dynamic-form-composite-field/dynamic-form-composite-field';
import { DynamicFormFieldComponent } from './dynamic-fields/dynamic-form-field.component';
import { DynamicFormComponent } from './dynamic-form/dynamic-form.component';
import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
import { SharedModule } from '../shared/shared.module';
import { HttpClient, HttpClientModule } from '@angular/common/http';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { CommonModule } from '@angular/common';
import { NgModule } from "@angular/core";
2018-05-14 08:44:35 +02:00
import { DatasetProfileAdmin } from '../services/datasetProfileAdmin/datasetProfileAfmin.service';
import { DatasetProfileService } from '../services/dataset-profile.service';
2018-01-30 10:35:26 +01:00
@NgModule({
2018-05-28 11:50:42 +02:00
imports: [
CommonModule,
FormsModule,
HttpClientModule,
SharedModule,
ReactiveFormsModule,
TranslateModule.forRoot({
loader: {
provide: TranslateLoader,
useFactory: HttpLoaderFactory,
deps: [HttpClient]
}
}),
],
2018-01-30 10:35:26 +01:00
2018-05-28 11:50:42 +02:00
declarations: [
DynamicFormComponent,
DynamicFormFieldComponent,
DynamicFormGroupComponent,
DynamicFormCompositeFieldComponent,
DynamicFieldBooleanDecisionComponent,
DynamicFieldRadioBoxComponent,
TableOfContentsComponent,
TableOfContentsFieldSetComponent,
TableOfContentsGroupComponent,
TableOfContentsSectionComponent,
AutocompleteRemoteComponent,
DynamicFieldDropdownComponent,
DynamicFormSectionComponent,
TableOfContentsFieldComponent,
ProgressBarComponent,
DynamicFieldCheckBoxComponent,
],
2018-01-30 10:35:26 +01:00
2018-05-28 11:50:42 +02:00
exports: [
DynamicFormComponent,
DynamicFormFieldComponent,
DynamicFormGroupComponent,
DynamicFormCompositeFieldComponent,
DynamicFieldBooleanDecisionComponent,
DynamicFieldRadioBoxComponent,
TableOfContentsComponent,
TableOfContentsFieldSetComponent,
TableOfContentsGroupComponent,
TableOfContentsSectionComponent,
AutocompleteRemoteComponent,
DynamicFieldDropdownComponent,
DynamicFormSectionComponent,
TableOfContentsFieldComponent,
ProgressBarComponent,
DynamicFieldCheckBoxComponent,
],
providers: [
VisibilityRulesService,
PaginationService,
DatasetProfileService,
DatasetProfileAdmin
]
2018-01-30 10:35:26 +01:00
})
export class DynamicFormModule { }
export function HttpLoaderFactory(httpClient: HttpClient) {
2018-05-28 11:50:42 +02:00
return new TranslateHttpLoader(httpClient, 'assets/lang/', '.json');
}