This commit is contained in:
Lurkars
2020-11-02 08:29:52 +01:00
commit b7b4e2d032
126 changed files with 18263 additions and 0 deletions
+32
View File
@@ -0,0 +1,32 @@
import { Component, OnInit, Input } from '@angular/core';
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { I18nService } from './../../services/i18n.service';
@Component({
selector: 'app-html',
templateUrl: './html.component.html',
styleUrls: ['./html.component.scss']
})
export class HtmlComponent implements OnInit {
htmlTemplate: any;
locale: String;
@Input() template;
constructor(private i18n: I18nService, private httpClient: HttpClient) {
this.locale = this.i18n.getLocale();
}
ngOnInit(): void {
const headers = new HttpHeaders()
.set('content-type', 'text/html');
this.httpClient.get(
'./assets/templates/' + this.template + (this.locale ? "." + this.locale : "") + ".html",
{
headers: headers,
responseType: 'text'
}).subscribe(response => this.htmlTemplate = response);
}
}