funky-framadate-front/src/app/features/administration/stepper/stepper.component.ts

39 lines
1.0 KiB
TypeScript

import { Component, Input, OnInit } from '@angular/core';
import { PollService } from '../../../core/services/poll.service';
import { environment } from '../../../../environments/environment';
import { ConfirmationService } from 'primeng/api';
import { Router } from '@angular/router';
@Component({
selector: 'app-stepper',
templateUrl: './stepper.component.html',
styleUrls: ['./stepper.component.scss'],
})
export class StepperComponent {
@Input()
public stepperConfirm: HTMLElement;
@Input()
public step_current: number = 1;
@Input()
public step_max: number = 5;
public environment = environment;
public show_shortcuts = environment.showStepperShortcuts;
display_cancel_dialog: boolean;
constructor(
public pollService: PollService,
private confirmationService: ConfirmationService,
private router: Router
) {
this.step_current = this.pollService.step_current;
}
showCancelDialog() {
this.display_cancel_dialog = true;
}
goToHome() {
this.display_cancel_dialog = false;
this.router.navigate(['/']);
}
}