diff options
Diffstat (limited to 'src/pybind/mgr/dashboard/frontend/src/app/app.module.ts')
-rw-r--r-- | src/pybind/mgr/dashboard/frontend/src/app/app.module.ts | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/src/pybind/mgr/dashboard/frontend/src/app/app.module.ts b/src/pybind/mgr/dashboard/frontend/src/app/app.module.ts new file mode 100644 index 000000000..970f3a112 --- /dev/null +++ b/src/pybind/mgr/dashboard/frontend/src/app/app.module.ts @@ -0,0 +1,51 @@ +import { APP_BASE_HREF } from '@angular/common'; +import { HttpClientModule, HTTP_INTERCEPTORS } from '@angular/common/http'; +import { ErrorHandler, NgModule } from '@angular/core'; +import { BrowserModule } from '@angular/platform-browser'; +import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; + +import { ToastrModule } from 'ngx-toastr'; + +import { AppRoutingModule } from './app-routing.module'; +import { AppComponent } from './app.component'; +import { CephModule } from './ceph/ceph.module'; +import { CoreModule } from './core/core.module'; +import { ApiInterceptorService } from './shared/services/api-interceptor.service'; +import { JsErrorHandler } from './shared/services/js-error-handler.service'; +import { SharedModule } from './shared/shared.module'; + +@NgModule({ + declarations: [AppComponent], + imports: [ + HttpClientModule, + BrowserModule, + BrowserAnimationsModule, + ToastrModule.forRoot({ + positionClass: 'toast-top-right', + preventDuplicates: true, + enableHtml: true + }), + AppRoutingModule, + CoreModule, + SharedModule, + CephModule + ], + exports: [SharedModule], + providers: [ + { + provide: ErrorHandler, + useClass: JsErrorHandler + }, + { + provide: HTTP_INTERCEPTORS, + useClass: ApiInterceptorService, + multi: true + }, + { + provide: APP_BASE_HREF, + useValue: '/' + (window.location.pathname.split('/', 1)[1] || '') + } + ], + bootstrap: [AppComponent] +}) +export class AppModule {} |