1
|
import {Injectable, Inject} from '@angular/core';
|
2
|
import {Http, Response} from '@angular/http';
|
3
|
import {HttpClient} from "@angular/common/http";
|
4
|
import {Observable} from 'rxjs';
|
5
|
|
6
|
|
7
|
|
8
|
import{EnvProperties} from '../properties/env-properties';
|
9
|
|
10
|
@Injectable()
|
11
|
export class HelperService {
|
12
|
constructor(private http: HttpClient) {}
|
13
|
|
14
|
getHelper (router: string, position: string, before: boolean, div: string, properties:EnvProperties,communityId:string ):any {
|
15
|
//console.info("get router helpText for : "+router+" - position="+position+" - before="+before + " - div="+div);
|
16
|
|
17
|
let url = properties.adminToolsAPIURL;
|
18
|
if(div) {
|
19
|
url += '/divhelpcontent?active=true&community='+communityId+'&page='+router+'&div=' + div;
|
20
|
} else {
|
21
|
url += '/pagehelpcontent?active=true&community='+communityId+'&page='+router+'&position=' + position;
|
22
|
if(before) {
|
23
|
url += '&before='+before;
|
24
|
}
|
25
|
}
|
26
|
|
27
|
return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url);
|
28
|
//.map(res => <any> res.json());
|
29
|
|
30
|
}
|
31
|
|
32
|
|
33
|
|
34
|
}
|