In Angular 16, withServerTransition is deprecated. How can I replace it?
enter image description here.
I tried the following code:
imports: [
BrowserModule,
{ provide: APP_ID, useValue: 'serverApp' },
...
],
But I'm getting the following error:
Type '{ provide: InjectionToken<string>; useValue: string; }' is not assignable to type 'any[] | Type<any> | ModuleWithProviders<{}>'.
Object literal may only specify known properties, and 'provide' does not exist in type 'any[] | Type<any> | ModuleWithProviders<{}>'.ts(2322)
(property) provide: InjectionToken<string>
You almost got it right, this should go in the providers object instead of the import
providers : [{ provide: APP_ID, useValue: 'serverApp' }],
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With