67 lines
2.2 KiB
TypeScript
67 lines
2.2 KiB
TypeScript
import { NgModule } from '@angular/core';
|
|
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
import { BrowserModule } from '@angular/platform-browser';
|
|
import { OAuthModule } from 'angular-oauth2-oidc';
|
|
import { HttpClientModule } from '@angular/common/http';
|
|
import { RouterModule, ExtraOptions } from '@angular/router';
|
|
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
|
|
|
import { AppComponent } from './app.component';
|
|
import { APP_ROUTES } from './app.routes';
|
|
import { USER_API_URL, TRAVEL_API_URL } from './app.config';
|
|
import { SharedModule } from './shared/shared.module';
|
|
import { useHash } from '../flags';
|
|
import { MaterialModule } from './material/material.module';
|
|
|
|
import { HomeComponent } from './pages/home/home.component';
|
|
import { TravelComponent } from './pages/travel/travel.component';
|
|
import { EditTravelComponent } from './pages/edit-travel/edit-travel.component';
|
|
|
|
import { HeaderComponent } from './views/header/header.component';
|
|
import { ListComponent } from './views/list/list.component';
|
|
import { TravelFormComponent } from './views/travel-form/travel-form.component';
|
|
import { NewTravelComponent } from './pages/new-travel/new-travel.component';
|
|
|
|
const ROUTING_OPTIONS: ExtraOptions = {
|
|
// preloadingStrategy: CustomPreloadingStrategy,
|
|
useHash,
|
|
initialNavigation: !useHash,
|
|
};
|
|
|
|
@NgModule({
|
|
imports: [
|
|
BrowserModule,
|
|
RouterModule.forRoot(APP_ROUTES, ROUTING_OPTIONS),
|
|
FormsModule,
|
|
ReactiveFormsModule,
|
|
HttpClientModule,
|
|
SharedModule.forRoot(),
|
|
OAuthModule.forRoot({
|
|
resourceServer: {
|
|
allowedUrls: [USER_API_URL, TRAVEL_API_URL],
|
|
sendAccessToken: true,
|
|
},
|
|
}),
|
|
BrowserAnimationsModule,
|
|
MaterialModule,
|
|
],
|
|
declarations: [
|
|
AppComponent,
|
|
HomeComponent,
|
|
TravelComponent,
|
|
EditTravelComponent,
|
|
HeaderComponent,
|
|
ListComponent,
|
|
TravelFormComponent,
|
|
NewTravelComponent
|
|
],
|
|
providers: [
|
|
// (useHash) ? { provide: LocationStrategy, useClass: HashLocationStrategy } : [],
|
|
// {provide: AuthConfig, useValue: authConfig },
|
|
// { provide: OAuthStorage, useValue: localStorage },
|
|
// { provide: ValidationHandler, useClass: JwksValidationHandler },
|
|
],
|
|
bootstrap: [AppComponent],
|
|
})
|
|
export class AppModule {}
|