openaire-library/contact-us/contact-us.component.ts

37 lines
995 B
TypeScript
Raw Normal View History

import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core';
import {FormGroup} from '@angular/forms';
import {EnvProperties} from "../utils/properties/env-properties";
import {Observable} from "rxjs";
import {map, startWith} from "rxjs/operators";
@Component({
selector: 'contact-us',
templateUrl: './contact-us.component.html',
styleUrls: ['contact-us.component.css']
})
export class ContactUsComponent {
@Input()
public contactForm: FormGroup;
@Input() formTitle: string;
@Input() properties: EnvProperties;
@Output() sendEmitter: EventEmitter<any> = new EventEmitter<any>();
@Input() errorMessage;
@Input()
public organizationTypes: string[];
@Input()
public right: boolean = true;
@Input()
public buttonClass: string;
public send() {
this.sendEmitter.emit({
valid: this.contactForm.valid
});
}
public handleRecaptcha(captchaResponse: string) {
this.contactForm.get('recaptcha').setValue(captchaResponse);
}
}