import { Component, Input } from '@angular/core'; import { FormGroup } from '@angular/forms'; import { QueryService } from '../../service/query.service'; @Component({ selector: 'rss-question-group', templateUrl: './question-group.component.html', styleUrls: ['./question-group.component.scss'] }) export class QuestionGroupComponent { @Input() group: FormGroup; @Input() questions: any[]; @Input() readonly: Boolean; @Input() required: Boolean; @Input() serverUrl: string; constructor(private queryService: QueryService) { } buildServerUrl(searchUrl: string) { if(!!this.serverUrl && !this.queryService.cachedSrvUrl) { this.queryService.cachedSrvUrl = this.serverUrl; } return (!!searchUrl) ? (this.queryService.cachedSrvUrl + searchUrl) : null; } }