/
index.ts
41 lines (36 loc) · 1.08 KB
/
index.ts
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
// Imports
import { NgModule, ModuleWithProviders } from '@angular/core';
import { HttpModule } from '@angular/http';
// Declarations
import { TranslateDirective } from './src/translate.directive';
import { TranslateService } from './src/translate.service';
import { TranslatePipe } from './src/translate.pipe';
// Exports
export { TranslateService } from './src/translate.service';
export { TranslateDirective } from './src/translate.directive';
export { TranslatePipe } from './src/translate.pipe';
@NgModule({
imports: [
HttpModule
],
declarations: [
TranslateDirective,
TranslatePipe
],
exports: [
TranslateDirective,
TranslatePipe
]
})
export class AngularTranslateJsonModule {
public static forRoot(config = null, values = null): ModuleWithProviders {
return {
ngModule: AngularTranslateJsonModule,
providers: [
{ provide: "CONFIG", useValue: config },
{ provide: "VALUES", useValue: values },
TranslateService
]
}
}
}