Project

General

Profile

1
import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core';
2
import {FormGroup} from '@angular/forms';
3
import {EnvProperties} from "../utils/properties/env-properties";
4

    
5
@Component({
6
    selector: 'contact-us',
7
    templateUrl: './contact-us.component.html',
8
})
9

    
10
export class ContactUsComponent implements OnInit {
11
    @Input()
12
    public contactForm: FormGroup;
13
    @Input() formTitle: string;
14
    @Input() properties: EnvProperties;
15
    @Output() sendEmitter: EventEmitter<any> = new EventEmitter<any>();
16
    @Input() errorMessage;
17

    
18
    constructor() {
19
    }
20

    
21
    ngOnInit() {
22
    }
23

    
24
    public send() {
25
        this.sendEmitter.emit({
26
            valid: this.contactForm.valid
27
        });
28
    }
29

    
30
    public handleRecaptcha(captchaResponse: string) {
31
        this.contactForm.get('recaptcha').setValue(captchaResponse);
32
    }
33
}
(2-2/3)