66 * found in the LICENSE file at https://angular.dev/license
77 */
88
9- import { Component , Type , provideExperimentalZonelessChangeDetection } from '@angular/core' ;
9+ import {
10+ Component ,
11+ EnvironmentProviders ,
12+ Provider ,
13+ Type ,
14+ provideExperimentalZonelessChangeDetection ,
15+ } from '@angular/core' ;
1016import { bootstrapApplication } from '@angular/platform-browser' ;
1117import { provideServerRendering } from '@angular/platform-server' ;
1218import { RouterOutlet , Routes , provideRouter } from '@angular/router' ;
@@ -35,6 +41,8 @@ class AppComponent {}
3541 * where the keys are asset paths and the values are asset details.
3642 * @param locale - An optional locale to configure for the application during testing.
3743 * @param rootComponent - The root Angular component to bootstrap the application.
44+ * @param extraProviders - An optional array of additional providers that should be available to the
45+ * root component and all its children.
3846 */
3947export function setAngularAppTestingManifest (
4048 routes : Routes ,
@@ -43,6 +51,7 @@ export function setAngularAppTestingManifest(
4351 additionalServerAssets : Record < string , ServerAsset > = { } ,
4452 locale ?: string ,
4553 rootComponent : Type < unknown > = AppComponent ,
54+ extraProviders : Array < Provider | EnvironmentProviders > = [ ] ,
4655) : void {
4756 destroyAngularServerApp ( ) ;
4857
@@ -89,6 +98,7 @@ export function setAngularAppTestingManifest(
8998 provideExperimentalZonelessChangeDetection ( ) ,
9099 provideRouter ( routes ) ,
91100 provideServerRoutesConfig ( serverRoutes ) ,
101+ ...extraProviders ,
92102 ] ,
93103 } ) ;
94104 } ,
0 commit comments