import { Injectable } from "@angular/core"; import { ConfigurationService } from "../configuration/configuration.service"; import { HttpClient, HttpResponse } from "@angular/common/http"; import { Observable } from "rxjs"; @Injectable() export class GlossaryService { private glossaryUrl : string; constructor( private http: HttpClient, private configurationService: ConfigurationService ) { this.glossaryUrl = `${configurationService.server}material/glossary`; } public getGlossary(lang: string): Observable> { return this.http.get(`${this.glossaryUrl}/${lang}`, { responseType: 'blob', observe: 'response', headers: {'Content-type': 'text/html', 'Accept': 'text/html', 'Access-Control-Allow-Origin': this.configurationService.app, 'Access-Control-Allow-Credentials': 'true'} }); } }