dependencies Legend  Declarations  Module  Bootstrap  Providers  Exports cluster_OauthPfeIntegrationModule cluster_OauthPfeIntegrationModule_imports cluster_OauthPfeIntegrationModule_providers OauthModule OauthModule OauthPfeIntegrationModule OauthPfeIntegrationModule OauthModule->OauthPfeIntegrationModule OauthPfeIntegrationService OauthPfeIntegrationService OauthPfeIntegrationService->OauthPfeIntegrationModule

File

libs/oauth/pfe/src/lib/oauth-pfe-integration/oauth-pfe-integration.module.ts

Methods

Static forRoot
forRoot(options: OauthOptions)
Parameters :
Name Type Optional
options OauthOptions No
import { ModuleWithProviders, NgModule } from '@angular/core';
import { OAUTH_CONFIGURATIONS, OauthModule, OauthOptions } from '@allianz/taly-oauth';
import { OauthPfeIntegrationService } from './oauth-pfe-integration.service';

@NgModule({
  providers: [OauthPfeIntegrationService],
  imports: [OauthModule]
})
export class OauthPfeIntegrationModule {
  /*
   * adding the pfe integration service as a dependency to ensure its constructor is called and registers
   * the PFE actions.
   */
  constructor(private oauthPfeIntegrationService: OauthPfeIntegrationService) {
    this.oauthPfeIntegrationService.registerActions();
  }

  static forRoot(options: OauthOptions): ModuleWithProviders<OauthPfeIntegrationModule> {
    return {
      ngModule: OauthPfeIntegrationModule,
      providers: [
        {
          provide: OAUTH_CONFIGURATIONS,
          useValue: options.configurations
        }
      ]
    };
  }
}

results matching ""

    No results matching ""