import { NgModule } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; import { AppRoutingModule } from './app-routing.module'; import { AppComponent } from './app.component'; import {LoginComponent} from "./auth/login/login.component"; import {FormsModule, ReactiveFormsModule} from "@angular/forms"; import {HttpClient, HttpClientModule, HttpHandler} from "@angular/common/http"; import {ApiModule, Configuration} from "../api"; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import {MatToolbarModule} from "@angular/material/toolbar"; import {MatLegacyButtonModule as MatButtonModule} from "@angular/material/legacy-button"; import {MatIconModule} from "@angular/material/icon"; import {MatLegacyDialogModule as MatDialogModule} from "@angular/material/legacy-dialog"; import {MatLegacyFormFieldModule as MatFormFieldModule} from "@angular/material/legacy-form-field"; import {MatLegacyInputModule as MatInputModule} from "@angular/material/legacy-input"; import {MatLegacyProgressSpinnerModule as MatProgressSpinnerModule} from "@angular/material/legacy-progress-spinner"; import {MatLegacySnackBar as MatSnackBar, MatLegacySnackBarModule as MatSnackBarModule} from "@angular/material/legacy-snack-bar"; import {MatLegacyMenuModule as MatMenuModule} from "@angular/material/legacy-menu"; import { AdminDashboardComponent } from './admin-dashboard/admin-dashboard.component'; import { MainComponent } from './main/main.component'; import { UsermanagementComponent } from './admin-dashboard/usermanagement/usermanagement.component'; import {MatLegacyTabsModule as MatTabsModule} from "@angular/material/legacy-tabs"; import {AuthService} from "./auth.service"; import {environment} from "../environments/environment"; import {MatLegacyTableModule as MatTableModule} from "@angular/material/legacy-table"; import {MatLegacyCheckboxModule as MatCheckboxModule} from "@angular/material/legacy-checkbox"; import { DeleteConfirmationComponent } from './admin-dashboard/usermanagement/delete-confirmation/delete-confirmation.component'; import { EditComponent } from './admin-dashboard/usermanagement/edit/edit.component'; import {MatLegacyCardModule as MatCardModule} from "@angular/material/legacy-card"; import {UserSettingsComponent} from "./user-settings/user-settings.component"; import {AccountSettingsComponent} from "./user-settings/account-settings/account-settings.component"; import { ChangePasswordComponent } from './user-settings/account-settings/change-password/change-password.component'; import { ManageEmailComponent } from './user-settings/account-settings/manage-email/manage-email.component'; import { DeleteAccountComponent } from './user-settings/account-settings/delete-account/delete-account.component'; import { RegistrationComponent } from './auth/registration/registration.component'; import { SettingsComponent } from './admin-dashboard/settings/settings.component'; import {MatLegacyListModule as MatListModule} from "@angular/material/legacy-list"; import { TaskgroupDashboardComponent } from './taskgroups/taskgroup-dashboard/taskgroup-dashboard.component'; import { TaskgroupCreationComponent } from './taskgroups/taskgroup-creation/taskgroup-creation.component'; import { TaskgroupDeletionComponent } from './taskgroups/taskgroup-deletion/taskgroup-deletion.component'; import { TaskEditorComponent } from './tasks/task-editor/task-editor.component'; import {MatDatepickerModule} from "@angular/material/datepicker"; @NgModule({ declarations: [ AppComponent, LoginComponent, AdminDashboardComponent, MainComponent, UsermanagementComponent, DeleteConfirmationComponent, EditComponent, UserSettingsComponent, AccountSettingsComponent, ChangePasswordComponent, ManageEmailComponent, DeleteAccountComponent, RegistrationComponent, SettingsComponent, TaskgroupDashboardComponent, TaskgroupCreationComponent, TaskgroupDeletionComponent, TaskEditorComponent ], imports: [ BrowserModule, AppRoutingModule, FormsModule, ApiModule, HttpClientModule, BrowserAnimationsModule, MatToolbarModule, MatButtonModule, MatIconModule, MatDialogModule, MatFormFieldModule, MatInputModule, MatProgressSpinnerModule, MatSnackBarModule, MatMenuModule, MatTabsModule, MatTableModule, MatCheckboxModule, MatCardModule, ReactiveFormsModule, MatListModule, MatDatepickerModule ], providers: [ HttpClientModule, /* This is the configuration for the code generated by OpenApiGenerator. It specifies that the API code should use our `AuthService` to get the currently stored JWT token. It also specifies where the base path (e.g. https://example.com/api/) for the api is. */ { provide: Configuration, useFactory: (authService: AuthService) => new Configuration( { credentials: { // We bind the `getAccessToken` function. This means that // the `this` instance in the `getAccessToken` function is bound to the singleton instance // Angular injected. Else, the function would be called without context and would lose its // context "API_TOKEN": authService.getAccessToken.bind(authService) }, //basePath: environment.api } ), deps: [AuthService], multi: false } ], bootstrap: [AppComponent] }) export class AppModule { }