import { Component, Input, OnInit } from '@angular/core'; import { Poll } from '../../../../core/models/poll.model'; import { FormGroup } from '@angular/forms'; import { environment } from 'src/environments/environment'; import { PollService } from '../../../../core/services/poll.service'; @Component({ selector: 'app-advanced-config', templateUrl: './advanced-config.component.html', styleUrls: ['./advanced-config.component.scss'], }) export class AdvancedConfigComponent implements OnInit { public urlPrefix = '/participation/'; public environment = environment; public displayClearPassword = false; @Input() public poll?: Poll; @Input() public form: FormGroup; domain_url: string; constructor(public pollService: PollService) {} ngOnInit(): void { this.domain_url = 'https://' + new URL(window.location.href).hostname + '/'; this.form.patchValue({ custom_url: this.pollService.makeSlug(this.pollService.form) }); } }