forked from tykayn/funky-framadate-front
35 lines
1.1 KiB
TypeScript
35 lines
1.1 KiB
TypeScript
import { Location } from '@angular/common';
|
|
import { Component, OnInit } from '@angular/core';
|
|
|
|
import { environment } from '../../../../src/environments/environment';
|
|
import { PollUtilitiesService } from '../../../../src/app/core/services/poll.utilities.service';
|
|
import { ConfigService } from '../../services/config.service';
|
|
import { BaseComponent } from '../example/base-page/base.component';
|
|
|
|
@Component({
|
|
selector: 'app-visibility',
|
|
templateUrl: './visibility.component.html',
|
|
styleUrls: ['./visibility.component.scss'],
|
|
})
|
|
export class VisibilityComponent extends BaseComponent implements OnInit {
|
|
public location: Location;
|
|
public showCustomPassword = false;
|
|
public baseUrl = environment.api.baseHref;
|
|
|
|
constructor(public config: ConfigService, public utils: PollUtilitiesService) {
|
|
super(config);
|
|
}
|
|
|
|
ngOnInit(): void {
|
|
this.config.customUrl = 'un custom_url';
|
|
this.config.expirationDate = this.config
|
|
.addDaysToDate(this.config.expiracyDateDefaultInDays, new Date())
|
|
.toISOString()
|
|
.substring(0, 10);
|
|
}
|
|
|
|
public submitCreationAndGoToEnd(): void {
|
|
this.config.createPoll();
|
|
}
|
|
}
|