-
Samart authoreda49aafd5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
import { BrowserModule } from "@angular/platform-browser";
import { BrowserAnimationsModule } from "@angular/platform-browser/animations";
import { HttpClientModule, HTTP_INTERCEPTORS } from "@angular/common/http";
import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from "@angular/core";
import { ReactiveFormsModule } from "@angular/forms";
import { AppRoutingModule } from "./app-routing.module";
import {
AuthLoggedIn,
AuthGuard,
AuthLoad,
AuthGuardWithRefresh,
} from "./core/auth-guard.service";
import { Globals } from "./core/global";
import { HttpService } from "./core/http.service";
import { JwtModule, JwtModuleOptions } from "@auth0/angular-jwt";
import { ModalService } from "./core/modal.service";
import { SharedComponentModule } from "./modules/shared/shared-component.module";
import { AppComponent } from "./app.component";
import { LoginComponent } from "./pages/login/login.component";
import { MainComponent } from "./pages/main/main.component";
import { PortalComponent } from "./pages/portal/portal.component";
import { RoleListComponent } from "./pages/portal/role-list.component";
import { MatSidenavModule } from "@angular/material/sidenav";
import { MaterialImportModule } from "./modules/shared/material.module";
import { ChangePasswordComponent } from "./pages/changepwd/changepwd.component";
import { NotFoundComponent } from "./pages/404/notfound.component";
import { MaintenanceComponent } from "./pages/maintenance/maintenance.component";
import { APP_BASE_HREF } from "@angular/common";
export function jwtTokenGetter() {
return localStorage.getItem("jwtToken") || "";
}
const JWT_Module_Options: JwtModuleOptions = {
config: {
tokenGetter: jwtTokenGetter,
},
};
@NgModule({
declarations: [
AppComponent,
LoginComponent,
ChangePasswordComponent,
MainComponent,
PortalComponent,
RoleListComponent,
NotFoundComponent,
MaintenanceComponent,
],
imports: [
BrowserModule,
HttpClientModule,
ReactiveFormsModule,
BrowserAnimationsModule,
MatSidenavModule,
AppRoutingModule,
SharedComponentModule,
MaterialImportModule,
JwtModule.forRoot(JWT_Module_Options),
],
providers: [
HttpService,
AuthLoggedIn,
AuthGuard,
AuthGuardWithRefresh,
AuthLoad,
Globals,
ModalService,
],
bootstrap: [AppComponent],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
export class AppModule {}