import { Component, Input, OnInit } from '@angular/core'; import { PollService } from '../../../core/services/poll.service'; import { Poll } from '../../../core/models/poll.model'; import { environment } from 'src/environments/environment'; import { Title } from '@angular/platform-browser'; @Component({ selector: 'app-success', templateUrl: './success.component.html', styleUrls: ['./success.component.scss'], }) export class SuccessComponent { @Input() poll: Poll; mailToRecieve: string; window: any = window; environment = environment; constructor(public pollService: PollService, private titleService: Title) { this.titleService.setTitle(environment.appTitle + ' - 🎉 succès de création de sondage -'); this.pollService.poll.subscribe((newpoll: Poll) => { this.poll = newpoll; }); } sendToEmail() { alert('todo'); } }