X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?p=it%2Fotf.git;a=blobdiff_plain;f=otf-frontend%2Fclient%2Fsrc%2Fapp%2Fapp.module.ts;fp=otf-frontend%2Fclient%2Fsrc%2Fapp%2Fapp.module.ts;h=ff1baba2eed54476b7e2c8865d49af4613232f97;hp=0000000000000000000000000000000000000000;hb=14f6f95c84a4a1fa8774190db4a03fd0214ec55f;hpb=f49bd1efeaaddd4891c1f329b18d8cfb28b3e75b diff --git a/otf-frontend/client/src/app/app.module.ts b/otf-frontend/client/src/app/app.module.ts new file mode 100644 index 0000000..ff1baba --- /dev/null +++ b/otf-frontend/client/src/app/app.module.ts @@ -0,0 +1,90 @@ +/* Copyright (c) 2019 AT&T Intellectual Property. # +# # +# Licensed under the Apache License, Version 2.0 (the "License"); # +# you may not use this file except in compliance with the License. # +# You may obtain a copy of the License at # +# # +# http://www.apache.org/licenses/LICENSE-2.0 # +# # +# Unless required by applicable law or agreed to in writing, software # +# distributed under the License is distributed on an "AS IS" BASIS, # +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # +# See the License for the specific language governing permissions and # +# limitations under the License. # +##############################################################################*/ + + +import {CommonModule} from '@angular/common'; +import {HTTP_INTERCEPTORS, HttpClient, HttpClientModule} from '@angular/common/http'; +import {NgModule} from '@angular/core'; +import {BrowserModule} from '@angular/platform-browser'; +import {BrowserAnimationsModule} from '@angular/platform-browser/animations'; +import {TranslateLoader, TranslateModule} from '@ngx-translate/core'; +import {TranslateHttpLoader} from '@ngx-translate/http-loader'; +import {AppRoutingModule} from './app-routing.module'; +import {AppComponent} from './app.component'; +import {AuthGuard, AdminGuard, SharedPipesModule, PageHeaderModule} from './shared'; +import {FormsModule} from '@angular/forms'; +import {ListService} from './shared/services/list.service'; +import {MatButtonModule, MatDatepickerModule, MatDialogModule, MatIconModule, MatInputModule, MatRadioModule, MatMenu, MatMenuModule} from '@angular/material'; +import {AppGlobals} from './app.global'; +import {ErrorInterceptor} from './error.interceptor'; +import {CookieService} from 'ngx-cookie-service'; +import {NgxMaterialTimepickerModule} from 'ngx-material-timepicker'; +import { SocketIoModule, SocketIoConfig } from 'ngx-socket-io'; +import { FeathersService } from './shared/services/feathers.service'; +import { CoreModule } from './core/core.module'; +import { AbilityModule } from '@casl/angular' + + +const config: SocketIoConfig = { url: '/', options: {transports: ['websocket']} }; + +// AoT requires an exported function for factories +export const createTranslateLoader = (http: HttpClient) => { + /* for development + return new TranslateHttpLoader( + http, + '/start-angular/SB-Admin-BS4-Angular-6/master/dist/assets/i18n/', + '.json' + ); */ + return new TranslateHttpLoader(http, './assets/i18n/', '.json'); +}; + +@NgModule({ + imports: [ + CommonModule, + BrowserModule, + FormsModule, + PageHeaderModule, + BrowserAnimationsModule, + HttpClientModule, + TranslateModule.forRoot({ + loader: { + provide: TranslateLoader, + useFactory: createTranslateLoader, + deps: [HttpClient] + } + }), + AppRoutingModule, + SharedPipesModule, + NgxMaterialTimepickerModule.forRoot(), + MatButtonModule, + MatDialogModule, + MatRadioModule, + MatInputModule, + MatIconModule, + MatDatepickerModule, + SocketIoModule.forRoot(config), + CoreModule, + MatMenuModule, + AbilityModule.forRoot() + ], + declarations: [ + AppComponent, + ], + providers: [ + FeathersService, {provide: HTTP_INTERCEPTORS, useClass: ErrorInterceptor, multi: true}, AuthGuard, AdminGuard, ListService, AppGlobals, CookieService], + bootstrap: [AppComponent] +}) +export class AppModule { +}