UNPKG

bdt105angulartranslatecomponent

Version:

Access to MySql database API

26 lines (21 loc) 679 B
import { NgModule, ModuleWithProviders, InjectionToken } from '@angular/core'; import { TranslateComponent } from './translate.component'; import { TranslateOptions } from './translateoptions.service'; export const USER_OPTIONS: InjectionToken<string> = new InjectionToken('Translate component user options'); @NgModule({ declarations: [ TranslateComponent ], exports: [TranslateComponent] }) export class TranslateModule { static forRoot(options: TranslateOptions): ModuleWithProviders { return { ngModule: TranslateModule, providers: [{ provide: USER_OPTIONS, useValue: options }] }; } };