1
|
import {Injectable, Inject} from '@angular/core';
|
2
|
import {Http, Response} from '@angular/http';
|
3
|
import {Observable} from 'rxjs/Observable';
|
4
|
import 'rxjs/add/observable/of';
|
5
|
import 'rxjs/add/operator/do';
|
6
|
import 'rxjs/add/operator/share';
|
7
|
import{EnvProperties} from '../openaireLibrary/utils/properties/env-properties';
|
8
|
|
9
|
@Injectable()
|
10
|
export class HtmlPageService {
|
11
|
constructor(private http: Http) {}
|
12
|
|
13
|
getHtmlContent (router: string, properties:EnvProperties, communityId:string ):any {
|
14
|
//console.info("get router html content for : "+router);
|
15
|
|
16
|
let url = properties.adminToolsAPIURL + '/htmlpagecontent?community='+communityId+'&page='+router;
|
17
|
|
18
|
return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url)
|
19
|
.map(res => <Array<any>> res.json());
|
20
|
|
21
|
}
|
22
|
|
23
|
|
24
|
|
25
|
}
|