diff options
author | Sonsino, Ofir (os0695) <os0695@intl.att.com> | 2018-07-10 15:57:37 +0300 |
---|---|---|
committer | Sonsino, Ofir (os0695) <os0695@intl.att.com> | 2018-07-10 15:57:37 +0300 |
commit | ff76b5ed0aa91d5fdf9dc4f95e8b20f91ed9d072 (patch) | |
tree | aae42404a93fdffdd16ff050eaa28129959f7577 /vid-webpack-master/src/app/app.module.ts | |
parent | c72d565bb58226b20625b2bce5f0019046bee649 (diff) |
New Angular UI from 1806
Change-Id: I39c160db0e0a6ec2e587ccf007ee1b23c6a08666
Issue-ID: VID-208
Signed-off-by: Sonsino, Ofir (os0695) <os0695@intl.att.com>
Diffstat (limited to 'vid-webpack-master/src/app/app.module.ts')
-rw-r--r-- | vid-webpack-master/src/app/app.module.ts | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/vid-webpack-master/src/app/app.module.ts b/vid-webpack-master/src/app/app.module.ts new file mode 100644 index 00000000..a87ffb5b --- /dev/null +++ b/vid-webpack-master/src/app/app.module.ts @@ -0,0 +1,79 @@ +import { ApplicationRef, NgModule } from '@angular/core'; +import { BrowserModule } from '@angular/platform-browser'; +import { HTTP_INTERCEPTORS, HttpClientModule } from '@angular/common/http'; +import { FormsModule, ReactiveFormsModule } from '@angular/forms'; +import { AppComponent } from './app.component'; +import { HomeComponent } from './home/home.component'; +import { ApiService } from './shared'; +import { routing } from './app.routing'; +import { createNewHosts, removeNgStyles } from '@angularclass/hmr'; +import { BrowseSdcModule } from './browseSdc/browseSdc.module'; +import { VlanTaggingModule } from './vlanTagging/vlan-tagging.module' +import { BootstrapModalModule } from 'ng2-bootstrap-modal'; +import { HashLocationStrategy, LocationStrategy } from "@angular/common"; +import { InstantiationStatusModule } from './instantiationStatus/InstantiationStatus.module'; +import { SharedModule } from './shared/shared.module'; +import { AngularSvgIconModule } from 'angular-svg-icon'; +import { NgReduxModule } from '@angular-redux/store'; +import { StoreModule } from "./store/module"; +import { HttpInterceptorService } from './shared/utils/httpInterceptor/httpInterceptor.service'; +import { DrawingBoardModule } from './drawingBoard/drawingBoard.module'; +import { HealthStatusComponent } from './healthStatus/health-status.component'; +import { ScrollToModule } from '@nicky-lenaers/ngx-scroll-to'; +import { LogService } from './shared/utils/log/log.service'; + +@NgModule({ + imports: [ + BrowserModule, + HttpClientModule, + FormsModule, + routing, + SharedModule.forRoot(), + ScrollToModule.forRoot(), + DrawingBoardModule, + VlanTaggingModule, + InstantiationStatusModule, + BrowseSdcModule, + BootstrapModalModule, + BrowseSdcModule, + AngularSvgIconModule, + ReactiveFormsModule, + NgReduxModule, + StoreModule, + ], + declarations: [ + AppComponent, + HomeComponent, + HealthStatusComponent + ], + providers: [ + ApiService, + LogService, + { provide: LocationStrategy, useClass: HashLocationStrategy }, + { provide: HTTP_INTERCEPTORS, useClass: HttpInterceptorService, multi: true } + ], + bootstrap: [AppComponent] +}) +export class AppModule { + private static CustomLoader: any; + + constructor(public appRef: ApplicationRef) { + //for ng2-bootstrap-modal in angualar 5 + Object.defineProperty(appRef, '_rootComponents', { get: () => appRef['components'] }); + } + hmrOnInit(store) { + console.log('HMR store', store); + } + hmrOnDestroy(store) { + let cmpLocation = this.appRef.components.map(cmp => cmp.location.nativeElement); + // recreate elements + store.disposeOldHosts = createNewHosts(cmpLocation); + // remove styles + removeNgStyles(); + } + hmrAfterDestroy(store) { + // display new elements + store.disposeOldHosts(); + delete store.disposeOldHosts; + } +} |