UNPKG

leaf-framework

Version:
23 lines 707 B
import 'rxjs/add/operator/map'; var JsonFileService = /** @class */ (function () { function JsonFileService(http) { this.http = http; } /** * Load the data defined in the json file */ JsonFileService.prototype.getData = function () { return this.http.get(this.getFilePath()).map(this.extractData); }; /** * Extract data that arrives from the response * @param res the response */ JsonFileService.prototype.extractData = function (res) { var body = res.json() || {}; return body.data || body; }; return JsonFileService; }()); export { JsonFileService }; //# sourceMappingURL=json-file.service.js.map