File

projects/core/src/routing/external-routes/external-routes.module.ts

Description

Prepends the external route that redirects to a different storefront system for configured URLs

Methods

Static forRoot
forRoot()
import { APP_INITIALIZER, ModuleWithProviders, NgModule } from '@angular/core';
import { addExternalRoutesFactory } from './external-routes.providers';
import { ExternalRoutesService } from './external-routes.service';

/**
 * Prepends the external route that redirects to a different storefront system for configured URLs
 */
@NgModule()
export class ExternalRoutesModule {
  static forRoot(): ModuleWithProviders<ExternalRoutesModule> {
    return {
      ngModule: ExternalRoutesModule,
      providers: [
        {
          provide: APP_INITIALIZER,
          multi: true,
          useFactory: addExternalRoutesFactory,
          deps: [ExternalRoutesService],
        },
      ],
    };
  }
}

result-matching ""

    No results matching ""