forked from frederikschubert/ng2-translate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathng2-translate.js
60 lines (60 loc) · 5.41 KB
/
ng2-translate.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
var core_1 = require("@angular/core");
var http_1 = require("@angular/http");
var translate_pipe_1 = require("./src/translate.pipe");
var translate_service_1 = require("./src/translate.service");
__export(require("./src/translate.pipe"));
__export(require("./src/translate.service"));
__export(require("./src/translate.parser"));
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = {
pipes: [translate_pipe_1.TranslatePipe],
providers: [translate_service_1.TranslateService]
};
function translateLoaderFactory(http) {
return new translate_service_1.TranslateStaticLoader(http);
}
exports.translateLoaderFactory = translateLoaderFactory;
var TranslateModule = (function () {
function TranslateModule() {
}
TranslateModule.forRoot = function (providedLoader) {
if (providedLoader === void 0) { providedLoader = {
provide: translate_service_1.TranslateLoader,
useFactory: translateLoaderFactory,
deps: [http_1.Http]
}; }
return {
ngModule: TranslateModule,
providers: [providedLoader, translate_service_1.TranslateService]
};
};
TranslateModule = __decorate([
core_1.NgModule({
imports: [http_1.HttpModule],
declarations: [
translate_pipe_1.TranslatePipe
],
exports: [
http_1.HttpModule,
translate_pipe_1.TranslatePipe
]
}),
__metadata('design:paramtypes', [])
], TranslateModule);
return TranslateModule;
}());
exports.TranslateModule = TranslateModule;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmcyLXRyYW5zbGF0ZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIm5nMi10cmFuc2xhdGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7OztBQUFBLHFCQUE0QyxlQUFlLENBQUMsQ0FBQTtBQUM1RCxxQkFBK0IsZUFBZSxDQUFDLENBQUE7QUFDL0MsK0JBQTRCLHNCQUFzQixDQUFDLENBQUE7QUFDbkQsa0NBQXVFLHlCQUF5QixDQUFDLENBQUE7QUFFakcsaUJBQWMsc0JBQXNCLENBQUMsRUFBQTtBQUNyQyxpQkFBYyx5QkFBeUIsQ0FBQyxFQUFBO0FBQ3hDLGlCQUFjLHdCQUF3QixDQUFDLEVBQUE7QUFHdkM7a0JBQWU7SUFDWCxLQUFLLEVBQUUsQ0FBQyw4QkFBYSxDQUFDO0lBQ3RCLFNBQVMsRUFBRSxDQUFDLG9DQUFnQixDQUFDO0NBQ2hDLENBQUM7QUFFRixnQ0FBdUMsSUFBVTtJQUM3QyxNQUFNLENBQUMsSUFBSSx5Q0FBcUIsQ0FBQyxJQUFJLENBQUMsQ0FBQztBQUMzQyxDQUFDO0FBRmUsOEJBQXNCLHlCQUVyQyxDQUFBO0FBWUQ7SUFBQTtJQVdBLENBQUM7SUFWVSx1QkFBTyxHQUFkLFVBQWUsY0FJZDtRQUpjLDhCQUlkLEdBSmM7WUFDWCxPQUFPLEVBQUUsbUNBQWU7WUFDeEIsVUFBVSxFQUFFLHNCQUFzQjtZQUNsQyxJQUFJLEVBQUUsQ0FBQyxXQUFJLENBQUM7U0FDZjtRQUNHL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