Stone, Avi (as206k) | 9b2ceb3 | 2018-04-12 16:36:39 +0300 | [diff] [blame] | 1 | import { BrowserModule } from '@angular/platform-browser'; |
| 2 | import { NgModule, APP_INITIALIZER } from '@angular/core'; |
| 3 | import { FormsModule, ReactiveFormsModule } from '@angular/forms'; |
| 4 | import { HttpModule } from '@angular/http'; |
| 5 | import { HttpClientModule } from '@angular/common/http'; |
| 6 | |
| 7 | import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; |
| 8 | import { MobxAngularModule } from 'mobx-angular'; |
| 9 | |
| 10 | import { TabViewModule, DialogModule, TooltipModule } from 'primeng/primeng'; |
| 11 | import { MatButtonModule } from '@angular/material/button'; |
| 12 | import { MatIconModule } from '@angular/material/icon'; |
| 13 | import { MatDialogModule } from '@angular/material/dialog'; |
| 14 | import { ToastrModule } from 'ngx-toastr'; |
| 15 | import { NgSelectModule } from '@ng-select/ng-select'; |
| 16 | |
| 17 | // import { SdcUiComponentsModule } from 'sdc-ui/lib/angular'; |
| 18 | |
| 19 | import { AppComponent } from './app.component'; |
| 20 | import { AppRoutingModule } from './app-routing.module'; |
| 21 | import { HomeComponent } from './home/home.component'; |
| 22 | import { GeneralComponent } from './general/general.component'; |
| 23 | import { MainComponent } from './main/main.component'; |
| 24 | import { RuleFrameComponent } from './rule-frame/rule-frame.component'; |
| 25 | |
| 26 | import { HostService } from './host/host.service'; |
| 27 | import { RestApiService } from './api/rest-api.service'; |
| 28 | import { FeatherIconsPipe } from './api/feather-pipe'; |
| 29 | import { Store } from './store/store'; |
| 30 | import { LoaderComponent } from './loader/loader.component'; |
| 31 | import { ErrorDialogComponent } from './error-dialog/error-dialog.component'; |
| 32 | |
| 33 | // rule engine |
| 34 | import { TreeModule } from 'angular-tree-component'; |
| 35 | import { TargetComponent } from './rule-engine/target/target.component'; |
| 36 | import { VersionTypeSelectComponent } from './rule-engine/version-type-select/version-type-select.component'; |
| 37 | import { FromComponent } from './rule-engine/from/from.component'; |
| 38 | import { ActionComponent } from './rule-engine/action/action.component'; |
| 39 | import { ActionListComponent } from './rule-engine/action-list/action-list.component'; |
| 40 | import { ConditionComponent } from './rule-engine/condition/condition.component'; |
| 41 | import { RuleEngineApiService } from './rule-engine/api/rule-engine-api.service'; |
| 42 | import { ConfirmPopupComponent } from './rule-engine/confirm-popup/confirm-popup.component'; |
| 43 | import { SlidePanelComponent } from './rule-engine/slide-panel/slide-panel.component'; |
| 44 | import { RuleListComponent } from './rule-engine/rule-list/rule-list.component'; |
| 45 | import { BarIconsComponent } from './bar-icons/bar-icons.component'; |
| 46 | import { DiagramComponent } from './diagram/diagram.component'; |
| 47 | |
| 48 | const appInitializerFn = () => { |
| 49 | return () => { |
| 50 | console.log('app initializing'); |
| 51 | }; |
| 52 | }; |
| 53 | |
| 54 | @NgModule({ |
| 55 | declarations: [ |
| 56 | AppComponent, |
| 57 | HomeComponent, |
| 58 | GeneralComponent, |
| 59 | MainComponent, |
| 60 | RuleFrameComponent, |
| 61 | LoaderComponent, |
| 62 | FeatherIconsPipe, |
| 63 | ErrorDialogComponent, |
| 64 | TargetComponent, |
| 65 | VersionTypeSelectComponent, |
| 66 | FromComponent, |
| 67 | ActionComponent, |
| 68 | ActionListComponent, |
| 69 | ConditionComponent, |
| 70 | ConfirmPopupComponent, |
| 71 | SlidePanelComponent, |
| 72 | RuleListComponent, |
| 73 | BarIconsComponent, |
| 74 | DiagramComponent |
| 75 | ], |
| 76 | imports: [ |
| 77 | BrowserModule, |
| 78 | BrowserAnimationsModule, |
| 79 | FormsModule, |
| 80 | HttpModule, |
| 81 | HttpClientModule, |
| 82 | AppRoutingModule, |
| 83 | MobxAngularModule, |
| 84 | TabViewModule, |
| 85 | DialogModule, |
| 86 | MatButtonModule, |
| 87 | MatIconModule, |
| 88 | MatDialogModule, |
| 89 | TreeModule, |
| 90 | NgSelectModule, |
| 91 | TooltipModule, |
| 92 | ToastrModule.forRoot({ enableHtml: true }) |
| 93 | ], |
| 94 | entryComponents: [ConfirmPopupComponent], |
| 95 | providers: [ |
| 96 | HostService, |
| 97 | RestApiService, |
| 98 | RuleEngineApiService, |
| 99 | Store, |
| 100 | { |
| 101 | provide: APP_INITIALIZER, |
| 102 | useFactory: appInitializerFn, |
| 103 | multi: true, |
| 104 | deps: [] |
| 105 | } |
| 106 | ], |
| 107 | bootstrap: [AppComponent] |
| 108 | }) |
| 109 | export class AppModule {} |