UNPKG

@fabioguelfi/angular-translate

Version:

A lightweight internationalization library for Angular applications

53 lines 1.57 kB
/** * @fileoverview added by tsickle * @suppress {checkTypes} checked by tsc */ import { Inject, Injectable } from '@angular/core'; import { HttpClient } from '@angular/common/http'; import { CONFIG } from './types/config.token'; export class LoaderService { /** * @param {?} http * @param {?} config */ constructor(http, config) { this.http = http; this.config = config; this.path = '/assets/languages/'; this.extension = '.json'; this.path = config.path ? config.path : this.path; } /** * @param {?} fileName * @return {?} */ getFile(fileName) { return this.http.get(this.path + fileName + this.extension); } } LoaderService.decorators = [ { type: Injectable } ]; /** @nocollapse */ LoaderService.ctorParameters = () => [ { type: HttpClient, }, { type: undefined, decorators: [{ type: Inject, args: [CONFIG,] },] }, ]; function LoaderService_tsickle_Closure_declarations() { /** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */ LoaderService.decorators; /** * @nocollapse * @type {function(): !Array<(null|{type: ?, decorators: (undefined|!Array<{type: !Function, args: (undefined|!Array<?>)}>)})>} */ LoaderService.ctorParameters; /** @type {?} */ LoaderService.prototype.path; /** @type {?} */ LoaderService.prototype.extension; /** @type {?} */ LoaderService.prototype.http; /** @type {?} */ LoaderService.prototype.config; } //# sourceMappingURL=loader.service.js.map