2020-05-05 18:17:12 +02:00
|
|
|
import { Injectable } from '@angular/core';
|
|
|
|
import { DialogService } from 'primeng';
|
|
|
|
|
2020-05-12 19:16:23 +02:00
|
|
|
import { ChoiceDetailsComponent } from '../../shared/components/choice-details/choice-details.component';
|
2020-05-05 18:17:12 +02:00
|
|
|
import { SettingsComponent } from '../../shared/components/settings/settings.component';
|
2020-05-12 19:16:23 +02:00
|
|
|
import { Choice } from '../models/choice.model';
|
2020-05-05 18:17:12 +02:00
|
|
|
|
|
|
|
@Injectable({
|
|
|
|
providedIn: 'root',
|
|
|
|
})
|
|
|
|
export class ModalService {
|
|
|
|
constructor(public dialogService: DialogService) {}
|
|
|
|
|
|
|
|
public openSettingsComponent(): void {
|
|
|
|
this.dialogService.open(SettingsComponent, { header: 'Paramètres', dismissableMask: true });
|
|
|
|
}
|
2020-05-12 19:16:23 +02:00
|
|
|
|
|
|
|
public openChoiceDetailsComponent(choice: Choice): void {
|
|
|
|
this.dialogService.open(ChoiceDetailsComponent, {
|
|
|
|
header: 'Détails des votes',
|
|
|
|
dismissableMask: true,
|
|
|
|
data: choice,
|
|
|
|
width: '70%',
|
|
|
|
});
|
|
|
|
}
|
2020-05-05 18:17:12 +02:00
|
|
|
}
|