@@ -127,15 +127,24 @@ export class AngularServerApp {
127127 return Response . redirect ( new URL ( redirectTo , url ) , 302 ) ;
128128 }
129129
130- const isSsrMode = serverContext === ServerRenderContext . SSR ;
131- const responseInit : ResponseInit = { } ;
132- const platformProviders : StaticProvider = [
130+ const platformProviders : StaticProvider [ ] = [
133131 {
134132 provide : SERVER_CONTEXT ,
135133 useValue : serverContext ,
136134 } ,
135+ {
136+ // An Angular Console Provider that does not print a set of predefined logs.
137+ provide : ɵConsole ,
138+ // Using `useClass` would necessitate decorating `Console` with `@Injectable`,
139+ // which would require switching from `ts_library` to `ng_module`. This change
140+ // would also necessitate various patches of `@angular/bazel` to support ESM.
141+ useFactory : ( ) => new Console ( ) ,
142+ } ,
137143 ] ;
138144
145+ const isSsrMode = serverContext === ServerRenderContext . SSR ;
146+ const responseInit : ResponseInit = { } ;
147+
139148 if ( isSsrMode ) {
140149 platformProviders . push (
141150 {
@@ -160,15 +169,6 @@ export class AngularServerApp {
160169 ɵresetCompiledComponents ( ) ;
161170 }
162171
163- // An Angular Console Provider that does not print a set of predefined logs.
164- platformProviders . push ( {
165- provide : ɵConsole ,
166- // Using `useClass` would necessitate decorating `Console` with `@Injectable`,
167- // which would require switching from `ts_library` to `ng_module`. This change
168- // would also necessitate various patches of `@angular/bazel` to support ESM.
169- useFactory : ( ) => new Console ( ) ,
170- } ) ;
171-
172172 const { manifest, hooks, assets } = this ;
173173
174174 let html = await assets . getIndexServerHtml ( ) ;
0 commit comments