1
|
import {Component, OnInit} from '@angular/core';
|
2
|
import {EnvProperties} from "../openaireLibrary/utils/properties/env-properties";
|
3
|
import {ActivatedRoute, Router} from "@angular/router";
|
4
|
import {HelperService} from "../openaireLibrary/utils/helper/helper.service";
|
5
|
|
6
|
|
7
|
@Component({
|
8
|
selector: 'theme',
|
9
|
templateUrl: 'helper-test.component.html',
|
10
|
})
|
11
|
|
12
|
export class HelperTestComponent implements OnInit{
|
13
|
|
14
|
public pageContents = null;
|
15
|
properties:EnvProperties;
|
16
|
|
17
|
constructor(private route: ActivatedRoute,
|
18
|
private _router: Router,
|
19
|
private helper: HelperService) {
|
20
|
|
21
|
}
|
22
|
|
23
|
ngOnInit(): void {
|
24
|
this.route.data
|
25
|
.subscribe((data: { envSpecific: EnvProperties }) => {
|
26
|
this.properties = data.envSpecific;
|
27
|
this.getPageContents();
|
28
|
});
|
29
|
}
|
30
|
|
31
|
private getPageContents() {
|
32
|
this.helper.getPageHelpContents(this._router.url, this.properties, 'connect').subscribe(contents => {
|
33
|
this.pageContents = contents;
|
34
|
})
|
35
|
}
|
36
|
|
37
|
}
|