You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Ombi/src/Ombi/ClientApp/app/app.module.ts

144 lines
5.0 KiB

7 years ago
import {CommonModule, PlatformLocation} from "@angular/common";
7 years ago
import {HttpClient, HttpClientModule} from "@angular/common/http";
import {NgModule} from "@angular/core";
import {FormsModule, ReactiveFormsModule} from "@angular/forms";
import {HttpModule} from "@angular/http";
import {MatButtonModule, MatCardModule, MatInputModule, MatTabsModule} from "@angular/material";
import {BrowserModule} from "@angular/platform-browser";
import {BrowserAnimationsModule} from "@angular/platform-browser/animations";
import {RouterModule, Routes} from "@angular/router";
import { JwtModule } from "@auth0/angular-jwt";
// Third Party
//import { DragulaModule, DragulaService } from 'ng2-dragula/ng2-dragula';
import { NgbModule } from "@ng-bootstrap/ng-bootstrap";
import { TranslateLoader, TranslateModule } from "@ngx-translate/core";
import { TranslateHttpLoader } from "@ngx-translate/http-loader";
7 years ago
import { CookieService } from "ng2-cookies";
import { GrowlModule } from "primeng/components/growl/growl";
import { ButtonModule, CaptchaModule,ConfirmationService, ConfirmDialogModule, DataTableModule,DialogModule, SharedModule, TooltipModule } from "primeng/primeng";
8 years ago
// Components
import { AppComponent } from "./app.component";
7 years ago
import { CookieComponent } from "./auth/cookie.component";
import { PageNotFoundComponent } from "./errors/not-found.component";
import { LandingPageComponent } from "./landingpage/landingpage.component";
import { LoginComponent } from "./login/login.component";
import { ResetPasswordComponent } from "./login/resetpassword.component";
import { TokenResetPasswordComponent } from "./login/tokenresetpassword.component";
// Services
import { AuthGuard } from "./auth/auth.guard";
import { AuthService } from "./auth/auth.service";
import { IdentityService } from "./services";
import { ImageService } from "./services";
import { LandingPageService } from "./services";
import { NotificationService } from "./services";
import { RequestService } from "./services";
import { SettingsService } from "./services";
import { StatusService } from "./services";
// Modules
import { RequestsModule } from "./requests/requests.module";
import { SearchModule } from "./search/search.module";
import { SettingsModule } from "./settings/settings.module";
import { UserManagementModule } from "./usermanagement/usermanagement.module";
import { WizardModule } from "./wizard/wizard.module";
const routes: Routes = [
{ path: "*", component: PageNotFoundComponent },
{ path: "", redirectTo: "/search", pathMatch: "full" },
//{ path: 'requests-grid', component: RequestGridComponent },
{ path: "login", component: LoginComponent },
{ path: "login/:landing", component: LoginComponent },
{ path: "reset", component: ResetPasswordComponent },
{ path: "token", component: TokenResetPasswordComponent },
{ path: "landingpage", component: LandingPageComponent },
7 years ago
{ path: "auth/cookie", component: CookieComponent },
];
// AoT requires an exported function for factories
7 years ago
export function HttpLoaderFactory(http: HttpClient, platformLocation: PlatformLocation) {
const base = platformLocation.getBaseHrefFromDOM();
if (base.length > 1) {
return new TranslateHttpLoader(http, `${base}/translations/`, ".json");
}
return new TranslateHttpLoader(http, "/translations/", ".json");
}
@NgModule({
imports: [
RouterModule.forRoot(routes),
BrowserModule,
HttpClientModule,
BrowserAnimationsModule,
HttpModule,
GrowlModule,
8 years ago
ButtonModule,
FormsModule,
8 years ago
SettingsModule,
DataTableModule,
8 years ago
SharedModule,
WizardModule,
SearchModule,
DialogModule,
MatButtonModule,
NgbModule.forRoot(),
MatCardModule,
MatInputModule,
MatTabsModule,
ReactiveFormsModule,
UserManagementModule,
RequestsModule,
CaptchaModule,
TooltipModule,
7 years ago
ConfirmDialogModule,
CommonModule,
JwtModule.forRoot({
config: {
tokenGetter: () => {
const token = localStorage.getItem("id_token");
if (!token) {
return "";
}
return token;
},
},
}),
TranslateModule.forRoot({
loader: {
provide: TranslateLoader,
useFactory: HttpLoaderFactory,
7 years ago
deps: [HttpClient, PlatformLocation],
},
}),
],
declarations: [
AppComponent,
PageNotFoundComponent,
8 years ago
LoginComponent,
LandingPageComponent,
ResetPasswordComponent,
TokenResetPasswordComponent,
7 years ago
CookieComponent,
],
providers: [
8 years ago
RequestService,
8 years ago
NotificationService,
AuthService,
AuthGuard,
SettingsService,
IdentityService,
StatusService,
LandingPageService,
ConfirmationService,
ImageService,
7 years ago
CookieService,
],
bootstrap: [AppComponent],
})
export class AppModule { }