dependencies Legend  Declarations  Module  Bootstrap  Providers  Exports cluster_NlpModule cluster_NlpModule_providers NlpService NlpService NlpModule NlpModule NlpService->NlpModule

File

src/app/core/voice/voice.module.ts

Providers

import { NgModule, ModuleWithProviders } from '@angular/core';
import { CommonModule } from '@angular/common';
import { DIALOGFLOW_TOKEN } from './inject-tokens';
import { NlpService } from './nlp.service';

export interface DialogflowTokenInterface {
  accessToken: string;
}

@NgModule({
  providers: [NlpService]
})
export class NlpModule {
  static forRoot(config: DialogflowTokenInterface): ModuleWithProviders {
    return {
      ngModule: NlpModule,
      providers: [
        {
          provide: DIALOGFLOW_TOKEN,
          useValue: config.accessToken
        }
      ]
    };
  }
}

results matching ""

    No results matching ""