import {Component, OnInit} from '@angular/core'; import {PrivatelyMarkedDialogComponent} from './privately-marked-dialog/privately-marked-dialog.component'; import {DialogService} from '../modals/dialog/dialog.service'; import {DialogComponent} from '../modals/dialog/dialog.component'; import {PatientContextService} from '../services/patient-context.service'; import {WindowService} from '../services/window.service'; @Component({ selector: 'app-privately-marked', templateUrl: './privately-marked.component.html', styleUrls: ['./privately-marked.component.scss'] }) export class PrivatelyMarkedComponent implements OnInit { constructor(private dialogService: DialogService, private patientContextService: PatientContextService, private windowService: WindowService, ) { } ngOnInit(): void { } openDialog(): void { this.dialogService .show(DialogComponent, { data: { header: 'Angiv årsag', component: PrivatelyMarkedDialogComponent, noButtonText: 'Fortryd', okButtonText: 'Vis oplysninger' }, width: '440' }) .subscribe((result) => { if (result) { this.patientContextService.setXBreakTheGlassReason('Værdispring'); this.windowService.nativeWindow().location.reload(); } }); } }