2018-06-25 17:03:52 +02:00
|
|
|
// angular modules
|
2018-06-13 18:34:10 +02:00
|
|
|
import { BrowserModule, Title } from '@angular/platform-browser';
|
2018-06-25 17:03:52 +02:00
|
|
|
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
2018-06-13 18:34:10 +02:00
|
|
|
import { NgModule } from '@angular/core';
|
2018-06-25 17:03:52 +02:00
|
|
|
import { FormsModule } from '@angular/forms';
|
2018-07-12 14:11:31 +02:00
|
|
|
import { HttpClientModule, HttpClient, HttpClientXsrfModule, HTTP_INTERCEPTORS } from '@angular/common/http';
|
2018-06-25 17:03:52 +02:00
|
|
|
|
|
|
|
// MaterialUI modules
|
|
|
|
import {
|
|
|
|
MatButtonModule,
|
|
|
|
MatCheckboxModule,
|
|
|
|
MatToolbarModule,
|
|
|
|
MatCardModule,
|
|
|
|
MatInputModule,
|
|
|
|
MatProgressSpinnerModule,
|
2018-06-28 12:20:37 +02:00
|
|
|
MatSidenavModule,
|
|
|
|
MatSnackBarModule
|
2018-06-25 17:03:52 +02:00
|
|
|
} from '@angular/material';
|
|
|
|
import { MatListModule } from '@angular/material/list';
|
|
|
|
import { MatExpansionModule } from '@angular/material/expansion';
|
|
|
|
import { MatMenuModule } from '@angular/material/menu';
|
|
|
|
|
|
|
|
// FontAwesome modules
|
2018-06-19 16:55:50 +02:00
|
|
|
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
|
|
|
|
import { library } from '@fortawesome/fontawesome-svg-core';
|
2018-06-13 18:34:10 +02:00
|
|
|
import { fas } from '@fortawesome/free-solid-svg-icons';
|
|
|
|
|
2018-06-25 17:03:52 +02:00
|
|
|
// App components and services
|
2018-06-13 18:34:10 +02:00
|
|
|
import { AppComponent } from './app.component';
|
2018-06-19 16:55:50 +02:00
|
|
|
import { LoginComponent } from './site/login/login.component';
|
2018-06-16 18:05:46 +02:00
|
|
|
import { AppRoutingModule } from './app-routing.module';
|
2018-06-28 12:20:37 +02:00
|
|
|
import { ProjectorComponent } from './projector-container/projector/projector.component';
|
2018-06-19 16:55:50 +02:00
|
|
|
import { MotionsComponent } from './site/motions/motions.component';
|
|
|
|
import { AgendaComponent } from './site/agenda/agenda.component';
|
2018-06-13 18:34:10 +02:00
|
|
|
import { SiteComponent } from './site/site.component';
|
2018-06-19 16:55:50 +02:00
|
|
|
import { StartComponent } from './site/start/start.component';
|
2018-07-12 14:11:31 +02:00
|
|
|
import { AddHeaderInterceptor } from './core/http-interceptor';
|
2018-06-28 12:20:37 +02:00
|
|
|
import { ProjectorContainerComponent } from './projector-container/projector-container.component';
|
2018-06-13 18:34:10 +02:00
|
|
|
|
2018-07-12 14:11:31 +02:00
|
|
|
// Root Services
|
|
|
|
import { AuthGuard } from './core/services/auth-guard.service';
|
|
|
|
import { AuthService } from './core/services/auth.service';
|
|
|
|
import { AutoupdateService } from './core/services/autoupdate.service';
|
|
|
|
import { DataStoreService } from './core/services/dataStore.service';
|
|
|
|
import { OperatorService } from './core/services/operator.service';
|
|
|
|
import { WebsocketService } from './core/services/websocket.service';
|
|
|
|
|
|
|
|
// translation module.
|
2018-06-29 17:24:44 +02:00
|
|
|
import { TranslateModule, TranslateLoader } from '@ngx-translate/core';
|
|
|
|
import { PruningTranslationLoader } from './core/pruning-loader';
|
2018-07-06 09:38:25 +02:00
|
|
|
import { OsPermsDirective } from './core/directives/os-perms.directive';
|
2018-06-29 17:24:44 +02:00
|
|
|
|
2018-07-12 14:11:31 +02:00
|
|
|
/**
|
|
|
|
* For the translation module. Loads a Custom 'translation loader' and provides it as loader.
|
|
|
|
* @param http Just the HttpClient to load stuff
|
|
|
|
*/
|
2018-06-29 17:24:44 +02:00
|
|
|
export function HttpLoaderFactory(http: HttpClient) {
|
|
|
|
return new PruningTranslationLoader(http);
|
|
|
|
}
|
|
|
|
|
2018-06-13 18:34:10 +02:00
|
|
|
//add font-awesome icons to library.
|
|
|
|
//will blow up the code.
|
|
|
|
library.add(fas);
|
|
|
|
|
|
|
|
@NgModule({
|
2018-06-19 16:55:50 +02:00
|
|
|
declarations: [
|
|
|
|
AppComponent,
|
|
|
|
LoginComponent,
|
|
|
|
ProjectorComponent,
|
|
|
|
MotionsComponent,
|
|
|
|
AgendaComponent,
|
|
|
|
SiteComponent,
|
|
|
|
StartComponent,
|
|
|
|
ProjectorContainerComponent,
|
2018-07-06 09:38:25 +02:00
|
|
|
OsPermsDirective
|
2018-06-19 16:55:50 +02:00
|
|
|
],
|
|
|
|
imports: [
|
|
|
|
BrowserModule,
|
|
|
|
HttpClientModule,
|
|
|
|
HttpClientXsrfModule.withOptions({
|
|
|
|
cookieName: 'OpenSlidesCsrfToken',
|
|
|
|
headerName: 'X-CSRFToken'
|
|
|
|
}),
|
|
|
|
FormsModule,
|
2018-06-25 17:03:52 +02:00
|
|
|
BrowserAnimationsModule,
|
|
|
|
MatButtonModule,
|
|
|
|
MatCheckboxModule,
|
|
|
|
MatToolbarModule,
|
|
|
|
MatCardModule,
|
|
|
|
MatInputModule,
|
|
|
|
MatProgressSpinnerModule,
|
|
|
|
MatSidenavModule,
|
|
|
|
MatListModule,
|
|
|
|
MatExpansionModule,
|
|
|
|
MatMenuModule,
|
2018-06-28 12:20:37 +02:00
|
|
|
MatSnackBarModule,
|
2018-06-19 16:55:50 +02:00
|
|
|
FontAwesomeModule,
|
2018-06-29 17:24:44 +02:00
|
|
|
TranslateModule.forRoot({
|
|
|
|
loader: {
|
|
|
|
provide: TranslateLoader,
|
|
|
|
useFactory: HttpLoaderFactory,
|
|
|
|
deps: [HttpClient]
|
|
|
|
}
|
|
|
|
}),
|
2018-06-19 16:55:50 +02:00
|
|
|
AppRoutingModule
|
|
|
|
],
|
2018-07-12 14:11:31 +02:00
|
|
|
providers: [
|
|
|
|
Title,
|
|
|
|
AuthGuard,
|
|
|
|
AuthService,
|
|
|
|
AutoupdateService,
|
|
|
|
DataStoreService,
|
|
|
|
OperatorService,
|
|
|
|
WebsocketService,
|
|
|
|
{
|
|
|
|
provide: HTTP_INTERCEPTORS,
|
|
|
|
useClass: AddHeaderInterceptor,
|
|
|
|
multi: true
|
|
|
|
}
|
|
|
|
],
|
2018-06-19 16:55:50 +02:00
|
|
|
bootstrap: [AppComponent]
|
2018-06-13 18:34:10 +02:00
|
|
|
})
|
2018-06-19 16:55:50 +02:00
|
|
|
export class AppModule {}
|