The Angular 17 blog post says:
You can add this feature to your app today by configuring it in the router’s provider declaration during bootstrap:
bootstrapApplication(App, {
providers: [
provideRouter(routes, withViewTransitions()),
]
});
However, I'm using NgModules, so my main.ts bootstrap looks like this:
platformBrowserDynamic().bootstrapModule(AppModule)
And the RouterModule is imported in the each of the modules, like:
@NgModule({
imports: [
RouterModule.forChild(routes),
]
So, no providers
and no provideRouter()
method. Where do I need to add withViewTransitions()
?
You you can do it with it
forRoot
. You need to set this up at the application level.This is defined in
ExtraOptions
.