2018-03-17 04:52:10 +01:00
|
|
|
import { BrowserModule } from "@angular/platform-browser";
|
|
|
|
import { FormsModule } from "@angular/forms";
|
|
|
|
import { HttpModule } from "@angular/http";
|
2018-09-08 05:17:19 +02:00
|
|
|
import { HttpClientModule } from '@angular/common/http';
|
2018-03-21 05:21:15 +01:00
|
|
|
import { NgModule, APP_INITIALIZER } from "@angular/core";
|
2018-03-17 02:42:10 +01:00
|
|
|
import { RouterModule, Routes } from "@angular/router";
|
2018-03-15 01:48:52 +01:00
|
|
|
|
2018-03-17 04:52:10 +01:00
|
|
|
import { NgxElectronModule } from "ngx-electron";
|
2018-03-15 01:48:52 +01:00
|
|
|
|
2018-08-07 03:07:28 +02:00
|
|
|
import { NgxsModule } from '@ngxs/store';
|
|
|
|
import { NgxsStoragePluginModule } from '@ngxs/storage-plugin';
|
|
|
|
|
2018-03-17 04:52:10 +01:00
|
|
|
import { AppComponent } from "./app.component";
|
|
|
|
import { LeftSideBarComponent } from "./components/left-side-bar/left-side-bar.component";
|
|
|
|
import { StreamsMainDisplayComponent } from "./pages/streams-main-display/streams-main-display.component";
|
|
|
|
import { StreamComponent } from "./components/stream/stream.component";
|
|
|
|
import { StreamsSelectionFooterComponent } from "./components/streams-selection-footer/streams-selection-footer.component";
|
|
|
|
import { TootComponent } from "./components/toot/toot.component";
|
|
|
|
import { RegisterNewAccountComponent } from "./pages/register-new-account/register-new-account.component";
|
|
|
|
import { AuthService } from "./services/auth.service";
|
2018-03-17 17:25:40 +01:00
|
|
|
import { AccountsService } from "./services/accounts.service";
|
2018-03-21 05:21:15 +01:00
|
|
|
import { StreamsService } from "./services/streams.service";
|
2018-03-22 05:31:34 +01:00
|
|
|
import { StreamingService } from "./services/streaming.service";
|
2018-08-15 03:32:13 +02:00
|
|
|
import { RegisteredAppsState } from "./states/registered-apps.state";
|
2018-03-15 01:48:52 +01:00
|
|
|
|
2018-03-17 02:42:10 +01:00
|
|
|
const routes: Routes = [
|
|
|
|
{ path: "", redirectTo: "home", pathMatch: "full" },
|
|
|
|
{ path: "home", component: StreamsMainDisplayComponent },
|
|
|
|
{ path: "register", component: RegisterNewAccountComponent},
|
|
|
|
{ path: "**", redirectTo: "home" }
|
|
|
|
];
|
2018-03-15 01:48:52 +01:00
|
|
|
|
|
|
|
@NgModule({
|
|
|
|
declarations: [
|
2018-03-16 01:43:53 +01:00
|
|
|
AppComponent,
|
|
|
|
LeftSideBarComponent,
|
2018-03-16 02:03:23 +01:00
|
|
|
StreamsMainDisplayComponent,
|
2018-03-16 02:41:25 +01:00
|
|
|
StreamComponent,
|
2018-03-16 04:48:30 +01:00
|
|
|
StreamsSelectionFooterComponent,
|
2018-03-17 02:42:10 +01:00
|
|
|
TootComponent,
|
|
|
|
RegisterNewAccountComponent
|
2018-03-15 01:48:52 +01:00
|
|
|
],
|
|
|
|
imports: [
|
2018-03-17 04:52:10 +01:00
|
|
|
BrowserModule,
|
|
|
|
HttpModule,
|
2018-09-08 05:17:19 +02:00
|
|
|
HttpClientModule,
|
2018-03-17 04:52:10 +01:00
|
|
|
FormsModule,
|
2018-03-17 02:42:10 +01:00
|
|
|
NgxElectronModule,
|
2018-08-07 03:07:28 +02:00
|
|
|
RouterModule.forRoot(routes),
|
|
|
|
|
|
|
|
NgxsModule.forRoot([
|
|
|
|
RegisteredAppsState
|
|
|
|
]),
|
|
|
|
NgxsStoragePluginModule.forRoot()
|
2018-03-15 01:48:52 +01:00
|
|
|
],
|
2018-09-08 06:49:11 +02:00
|
|
|
providers: [AuthService, AccountsService, StreamsService, StreamingService, { provide: APP_INITIALIZER, useFactory: settingsServiceFactory, deps: [AccountsService], multi: true }],
|
2018-03-15 01:48:52 +01:00
|
|
|
bootstrap: [AppComponent]
|
|
|
|
})
|
|
|
|
export class AppModule { }
|
2018-03-21 05:21:15 +01:00
|
|
|
|
|
|
|
function settingsServiceFactory(service: AccountsService) {
|
|
|
|
return () => service.load();
|
|
|
|
}
|