File tree 1 file changed +3
-13
lines changed
packages/angular/ssr/src/routes 1 file changed +3
-13
lines changed Original file line number Diff line number Diff line change 8
8
9
9
import { APP_BASE_HREF , PlatformLocation } from '@angular/common' ;
10
10
import {
11
- APP_INITIALIZER ,
12
11
ApplicationRef ,
13
12
Compiler ,
14
- ComponentRef ,
15
13
Injector ,
16
- inject ,
17
14
runInInjectionContext ,
18
15
ɵConsole ,
16
+ ɵENABLE_ROOT_COMPONENT_BOOTSTRAP ,
19
17
} from '@angular/core' ;
20
18
import { INITIAL_CONFIG , platformServer } from '@angular/platform-server' ;
21
19
import {
@@ -493,16 +491,8 @@ export async function getRoutesFromAngularRouterConfig(
493
491
useFactory : ( ) => new Console ( ) ,
494
492
} ,
495
493
{
496
- // We cannot replace `ApplicationRef` with a different provider here due to the dependency injection (DI) hierarchy.
497
- // This code is running at the platform level, where `ApplicationRef` is provided in the root injector.
498
- // As a result, any attempt to replace it will cause the root provider to override the platform provider.
499
- // TODO(alanagius): investigate exporting the app config directly which would help with: https://github.com/angular/angular/issues/59144
500
- provide : APP_INITIALIZER ,
501
- multi : true ,
502
- useFactory : ( ) => ( ) => {
503
- const appRef = inject ( ApplicationRef ) ;
504
- appRef . bootstrap = ( ) => undefined as unknown as ComponentRef < unknown > ;
505
- } ,
494
+ provide : ɵENABLE_ROOT_COMPONENT_BOOTSTRAP ,
495
+ useValue : false ,
506
496
} ,
507
497
] ) ;
508
498
You can’t perform that action at this time.
0 commit comments