import { Component, OnInit } from '@angular/core'; import { BaseComponent } from '../base-page/base.component'; import { ConfigService } from '../../services/config.service'; import { environment } from '../../../environments/environment'; import { PollUtilities } from '../../config/PollUtilities'; @Component({ selector: 'framadate-visibility', templateUrl: './visibility.component.html', styleUrls: ['./visibility.component.scss'], }) export class VisibilityComponent extends BaseComponent implements OnInit { showCustomPassword = false; baseUrl = environment.api.baseHref; environment = environment; constructor(public config: ConfigService, public utils: PollUtilities) { super(config); } ngOnInit() { this.config.customUrl = this.utils.makeSlug(this.config); this.config.expirationDate = this.config .addDaysToDate(this.config.expiracyDateDefaultInDays, new Date()) .toISOString() .substring(0, 10); } submitCreationAndGoToEnd() { this.config.createPoll(); } }