Skip to content

Commit

Permalink
fix(core/transloco): add module forRoot function
Browse files Browse the repository at this point in the history
  • Loading branch information
peppedeka committed Jul 27, 2021
1 parent 8632c9b commit 9112607
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/core/transloco/transloco.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*
*/

import {NgModule} from '@angular/core';
import {ModuleWithProviders, NgModule} from '@angular/core';
import {
TRANSLOCO_CONFIG,
TRANSLOCO_MISSING_HANDLER,
Expand Down Expand Up @@ -56,4 +56,12 @@ export class AjfTranslocoModule {
}
});
}
static forRoot(): ModuleWithProviders<AjfTranslocoModule> {
return {
ngModule: AjfTranslocoModule,
providers: [
TranslocoService,
]
};
}
}
1 change: 1 addition & 0 deletions tools/public_api_guard/core/transloco.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ export declare class AjfTranslocoModule {
static ɵfac: i0.ɵɵFactoryDeclaration<AjfTranslocoModule, never>;
static ɵinj: i0.ɵɵInjectorDeclaration<AjfTranslocoModule>;
static ɵmod: i0.ɵɵNgModuleDeclaration<AjfTranslocoModule, never, [typeof i1.TranslocoModule], [typeof i1.TranslocoModule]>;
static forRoot(): ModuleWithProviders<AjfTranslocoModule>;
}

export declare const langs: {
Expand Down

0 comments on commit 9112607

Please sign in to comment.