src/kl/core/services/httpclient.ts
@@ -4,6 +4,8 @@ import { LoadingService } from './loading.service'; import { ApiResult } from 'kl/model'; @Injectable() export class HttpClient { @@ -17,6 +19,13 @@ this.getResponse(this.http.post(api, params), fun); } getData(id: string, fun: Function) { return this.http.get('assets/json/data.json').map((res: Response) => res.json()).subscribe(data => { fun(data[id]); }); } xhrPost(api, data, fun) { let xhr = new XMLHttpRequest(); xhr.open('POST', api, false);