diff --git a/projects/ngx-meta/api-extractor/ngx-meta.api.md b/projects/ngx-meta/api-extractor/ngx-meta.api.md index 3c7ada5a..d28b7552 100644 --- a/projects/ngx-meta/api-extractor/ngx-meta.api.md +++ b/projects/ngx-meta/api-extractor/ngx-meta.api.md @@ -374,7 +374,7 @@ export const provideNgxMetaOpenGraph: () => Provider[]; export const provideNgxMetaOpenGraphProfile: () => Provider[]; // @public -export const provideNgxMetaRouting: () => Provider[]; +export const provideNgxMetaRouting: () => EnvironmentProviders; // @public export const provideNgxMetaStandard: () => Provider[]; diff --git a/projects/ngx-meta/src/routing/src/providers/ngx-meta-routing.module.ts b/projects/ngx-meta/src/routing/src/providers/ngx-meta-routing.module.ts index 8304eadf..a6969384 100644 --- a/projects/ngx-meta/src/routing/src/providers/ngx-meta-routing.module.ts +++ b/projects/ngx-meta/src/routing/src/providers/ngx-meta-routing.module.ts @@ -14,7 +14,7 @@ export class NgxMetaRoutingModule { static forRoot(): ModuleWithProviders { return { ngModule: NgxMetaRoutingModule, - providers: provideNgxMetaRouting(), + providers: [provideNgxMetaRouting()], } } } diff --git a/projects/ngx-meta/src/routing/src/providers/provide-ngx-meta-routing.ts b/projects/ngx-meta/src/routing/src/providers/provide-ngx-meta-routing.ts index 1579c925..0346b00e 100644 --- a/projects/ngx-meta/src/routing/src/providers/provide-ngx-meta-routing.ts +++ b/projects/ngx-meta/src/routing/src/providers/provide-ngx-meta-routing.ts @@ -1,4 +1,9 @@ -import { ENVIRONMENT_INITIALIZER, inject, Provider } from '@angular/core' +import { + ENVIRONMENT_INITIALIZER, + EnvironmentProviders, + inject, + makeEnvironmentProviders, +} from '@angular/core' import { _ROUTE_METADATA_STRATEGY } from '@davidlj95/ngx-meta/core' import { DEFAULT_ROUTE_METADATA_STRATEGY } from '../route-metadata/default-route-metadata-strategy' import { ROUTER_LISTENER } from '../listener/router-listener' @@ -14,14 +19,15 @@ import { ROUTER_LISTENER } from '../listener/router-listener' * * @public */ -export const provideNgxMetaRouting = (): Provider[] => [ - { - provide: _ROUTE_METADATA_STRATEGY, - useExisting: DEFAULT_ROUTE_METADATA_STRATEGY, - }, - { - provide: ENVIRONMENT_INITIALIZER, - multi: true, - useFactory: () => inject(ROUTER_LISTENER).listen, - }, -] +export const provideNgxMetaRouting = (): EnvironmentProviders => + makeEnvironmentProviders([ + { + provide: _ROUTE_METADATA_STRATEGY, + useExisting: DEFAULT_ROUTE_METADATA_STRATEGY, + }, + { + provide: ENVIRONMENT_INITIALIZER, + multi: true, + useFactory: () => inject(ROUTER_LISTENER).listen, + }, + ])