Sengi-Windows-MacOS-Linux/Mamoth/src/app/app.module.ts

52 lines
2.0 KiB
TypeScript
Raw Normal View History

2018-03-17 04:52:10 +01:00
import { BrowserModule } from "@angular/platform-browser";
import { FormsModule } from "@angular/forms";
import { HttpModule } from "@angular/http";
import { NgModule, APP_INITIALIZER } from "@angular/core";
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-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";
import { StreamsService } from "./services/streams.service";
2018-03-15 01:48:52 +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,
TootComponent,
RegisterNewAccountComponent
2018-03-15 01:48:52 +01:00
],
imports: [
2018-03-17 04:52:10 +01:00
BrowserModule,
HttpModule,
FormsModule,
NgxElectronModule,
RouterModule.forRoot(routes)
2018-03-15 01:48:52 +01:00
],
providers: [AuthService, AccountsService, StreamsService, { provide: APP_INITIALIZER, useFactory: settingsServiceFactory, deps: [AccountsService], multi: true }],
2018-03-15 01:48:52 +01:00
bootstrap: [AppComponent]
})
export class AppModule { }
function settingsServiceFactory(service: AccountsService) {
return () => service.load();
}