import { InjectionToken , NgModule } from "@angular/core" ; import { CommonModule } from "@angular/common" ; import { AppVersionComponent } from "./app-version/app-version.component" ; import { AlertsModule } from "../alerts/alerts.module" ; import { HttpClientModule } from "@angular/common/http" ; import { SessionModule } from "../session/session.module" ; import { MatButtonModule } from "@angular/material/button" ; import { MatDialogModule } from "@angular/material/dialog" ; import { MatSnackBarModule } from "@angular/material/snack-bar" ; import { ChangelogComponent } from "./changelog/changelog.component" ; import { SwUpdate } from "@angular/service-worker" ; import { UpdateManagerService } from "./update-manager.service" ; import { FlexModule } from "@angular/flex-layout" ; import { MarkdownModule } from "ngx-markdown" ; import { MatCardModule } from "@angular/material/card" ; import { LatestChangesDialogService } from "./latest-changes-dialog.service" ; import { LatestChangesService } from "./latest-changes.service" ; import { FontAwesomeModule } from "@fortawesome/angular-fontawesome" ; export const LOCATION_TOKEN = new InjectionToken < Location > ( "Window location object" ) ; /**
 * Displaying app version and changelog information to the user
 * through components that can be used in other templates
 * as well as automatic popups on updates (see  UpdateManagerService ,  LatestChangesService ).
 *
 * Changelogs are dynamically loaded from GitHub Releases through the GitHub API.
 * pre-releases are excluded and individual lines in the body can be hidden by starting
 * text (after markdown characters) with a ".".
  @ NgModule ( { imports : [ CommonModule , AlertsModule , SessionModule , MatDialogModule , MatButtonModule , MatSnackBarModule , HttpClientModule , FlexModule , MarkdownModule , MatCardModule , FontAwesomeModule , ] , declarations : [ AppVersionComponent , ChangelogComponent ] , exports : [ AppVersionComponent ] , providers : [ LatestChangesService , LatestChangesDialogService , UpdateManagerService , { provide : LOCATION_TOKEN , useValue : window . location } , ] , } ) export class LatestChangesModule { constructor ( private updates , private latestChangesDialogService , private updateManagerService ) { this . updateManagerService . notifyUserWhenUpdateAvailable ( ) ; this . updateManagerService . regularlyCheckForUpdates ( ) ; this . latestChangesDialogService . showLatestChangesIfUpdated ( ) ; } }