37 lines
1.3 KiB
TypeScript
37 lines
1.3 KiB
TypeScript
import { Component, OnInit } from '@angular/core';
|
|
import { SafeResourceUrl, DomSanitizer } from '@angular/platform-browser';
|
|
import { LanguageService } from '@app/core/services/language/language.service';
|
|
import { MatomoService } from '@app/core/services/matomo/matomo-service';
|
|
import { TermsOfServiceService } from '@app/core/services/terms-of-service/terms-of-service.service';
|
|
import { BaseComponent } from '@common/base/base.component';
|
|
import { takeUntil } from 'rxjs/operators';
|
|
|
|
@Component({
|
|
selector: 'app-terms',
|
|
templateUrl: './terms.component.html',
|
|
styleUrls: ['./terms.component.scss']
|
|
})
|
|
export class TermsComponent extends BaseComponent implements OnInit {
|
|
|
|
termsHTMLUrl: SafeResourceUrl;
|
|
sanitizedGuideUrl: any;
|
|
|
|
constructor(
|
|
private termsService: TermsOfServiceService,
|
|
private sanitizer: DomSanitizer,
|
|
private languageService: LanguageService,
|
|
private matomoService: MatomoService
|
|
) { super(); }
|
|
|
|
ngOnInit() {
|
|
this.matomoService.trackPageView('Terms of Service');
|
|
this.termsService.getTermsOfService(this.languageService.getCurrentLanguage())
|
|
.pipe(takeUntil(this._destroyed))
|
|
.subscribe(response => {
|
|
const blob = new Blob([response.body], { type: 'text/html' });
|
|
this.termsHTMLUrl = this.sanitizer.bypassSecurityTrustResourceUrl((window.URL ? URL : webkitURL).createObjectURL(blob));
|
|
});
|
|
}
|
|
|
|
}
|