a8cbb2cc9709fb259bd6ce1c7a0b3b4af422c51d
[portal/nonrtric-controlpanel.git] / webapp-frontend / src / app / app.module.ts
1 /*-
2  * ========================LICENSE_START=================================
3  * O-RAN-SC
4  * %%
5  * Copyright (C) 2019 AT&T Intellectual Property
6  * Modifications Copyright (C) 2019 Nordix Foundation
7  * Modifications Copyright (C) 2020 Nordix Foundation
8  * %%
9  * Licensed under the Apache License, Version 2.0 (the "License");
10  * you may not use this file except in compliance with the License.
11  * You may obtain a copy of the License at
12  *
13  *      http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  * ========================LICENSE_END===================================
21  */
22 import { BrowserModule } from '@angular/platform-browser';
23 import { MatDialogModule } from '@angular/material/dialog';
24 import { MatIconModule } from '@angular/material/icon';
25 import {MatListModule} from '@angular/material/list';
26 import { MatSidenavModule } from '@angular/material/sidenav';
27 import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
28 import { HttpClientModule, HTTP_INTERCEPTORS } from '@angular/common/http';
29 import { NgModule } from '@angular/core';
30 import { MDBBootstrapModule } from 'angular-bootstrap-md';
31 import { ToastrModule } from 'ngx-toastr';
32 import { ConfirmDialogComponent } from '@ui/confirm-dialog/confirm-dialog.component';
33 import { FooterComponent } from './footer/footer.component';
34 import { MainComponent } from './main/main.component';
35 import { MaterialDesignFrameworkModule } from 'angular6-json-schema-form';
36 import { PolicyModule } from '@policy/policy.module'
37 import { EiCoordinatorModule } from '@ei-coordinator/ei-coordinator.module'
38 import { AppComponent } from './app.component';
39 import { AppRoutingModule } from './app-routing.module';
40 import { SidenavListComponent } from '@navigation/sidenav-list/sidenav-list.component';
41 import { UiService } from '@services/ui/ui.service';
42 import { CookieService } from 'ngx-cookie-service';
43 import { HttpMockRequestInterceptor } from './interceptor.mock';
44 import { environment } from 'environments/environment';
45 import { HttpRequestInterceptor } from './interceptor';
46 import { MatSlideToggleModule } from '@angular/material/slide-toggle';
47
48 export const isMock = environment.mock;
49
50 @NgModule({
51   declarations: [
52     AppComponent,
53     ConfirmDialogComponent,
54     FooterComponent,
55     MainComponent,
56     SidenavListComponent,
57   ],
58   imports: [
59     AppRoutingModule,
60     BrowserModule,
61     BrowserAnimationsModule,
62     HttpClientModule,
63     MatDialogModule,
64     MatIconModule,
65     MatListModule,
66     MatSidenavModule,
67     MatSlideToggleModule,
68     MaterialDesignFrameworkModule,
69     MDBBootstrapModule.forRoot(),
70     PolicyModule,
71     EiCoordinatorModule,
72     ToastrModule.forRoot(),
73   ],
74   entryComponents: [
75     ConfirmDialogComponent,
76   ],
77   providers: [
78     CookieService,
79     UiService,
80     {
81       provide: HTTP_INTERCEPTORS,
82       useClass: isMock ? HttpMockRequestInterceptor : HttpRequestInterceptor,
83       multi: true
84       }
85   ],
86   bootstrap: [AppComponent]
87 })
88 export class AppModule { }