66 * found in the LICENSE file at https://angular.dev/license
77 */
88
9- import { Component , provideExperimentalZonelessChangeDetection } from '@angular/core' ;
9+ import { Component , Type , provideExperimentalZonelessChangeDetection } from '@angular/core' ;
1010import { bootstrapApplication } from '@angular/platform-browser' ;
1111import { provideServerRendering } from '@angular/platform-server' ;
1212import { RouterOutlet , Routes , provideRouter } from '@angular/router' ;
1313import { destroyAngularServerApp } from '../src/app' ;
1414import { ServerAsset , setAngularAppManifest } from '../src/manifest' ;
1515import { ServerRoute , provideServerRoutesConfig } from '../src/routes/route-config' ;
1616
17+ @Component ( {
18+ standalone : true ,
19+ selector : 'app-root' ,
20+ template : '<router-outlet />' ,
21+ imports : [ RouterOutlet ] ,
22+ } )
23+ class AppComponent { }
24+
1725/**
1826 * Configures the Angular application for testing by setting up the Angular app manifest,
1927 * configuring server-side rendering, and bootstrapping the application with the provided routes.
@@ -26,24 +34,18 @@ import { ServerRoute, provideServerRoutesConfig } from '../src/routes/route-conf
2634 * @param additionalServerAssets - A record of additional server assets to include,
2735 * where the keys are asset paths and the values are asset details.
2836 * @param locale - An optional locale to configure for the application during testing.
37+ * @param rootComponent - The root Angular component to bootstrap the application.
2938 */
3039export function setAngularAppTestingManifest (
3140 routes : Routes ,
3241 serverRoutes : ServerRoute [ ] ,
3342 baseHref = '/' ,
3443 additionalServerAssets : Record < string , ServerAsset > = { } ,
3544 locale ?: string ,
45+ rootComponent : Type < unknown > = AppComponent ,
3646) : void {
3747 destroyAngularServerApp ( ) ;
3848
39- @Component ( {
40- standalone : true ,
41- selector : 'app-root' ,
42- template : '<router-outlet />' ,
43- imports : [ RouterOutlet ] ,
44- } )
45- class AppComponent { }
46-
4749 setAngularAppManifest ( {
4850 inlineCriticalCss : false ,
4951 baseHref,
@@ -81,7 +83,7 @@ export function setAngularAppTestingManifest(
8183 } ,
8284 } ,
8385 bootstrap : async ( ) => ( ) => {
84- return bootstrapApplication ( AppComponent , {
86+ return bootstrapApplication ( rootComponent , {
8587 providers : [
8688 provideServerRendering ( ) ,
8789 provideExperimentalZonelessChangeDetection ( ) ,
0 commit comments