Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add withViewTransitions #1734

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/app/app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { provideHttpClient, withFetch, withInterceptors } from '@angular/common/
import ngLang from '@angular/common/locales/zh';
import { APP_ID, ApplicationConfig, ErrorHandler, importProvidersFrom } from '@angular/core';
import { provideAnimations } from '@angular/platform-browser/animations';
import { provideRouter, withComponentInputBinding } from '@angular/router';
import { provideRouter, withComponentInputBinding, withViewTransitions, withInMemoryScrolling } from '@angular/router';
import { ServiceWorkerModule } from '@angular/service-worker';

import { provideNuMonacoEditorConfig } from '@ng-util/monaco-editor';
Expand Down Expand Up @@ -92,7 +92,12 @@ export const appConfig: ApplicationConfig = {
{ provide: APP_ID, useValue: 'ngAlainDoc' },
provideHttpClient(withFetch(), withInterceptors([mockInterceptor])),
provideAnimations(),
provideRouter(routes, withComponentInputBinding()),
provideRouter(
routes,
withComponentInputBinding(),
withViewTransitions(),
withInMemoryScrolling({ scrollPositionRestoration: 'top' })
),
// provideClientHydration(), // 暂时不开启水合,除了编译时间长,还有就是对DOM要求比较高
provideAlain({ config: alainConfig, defaultLang, i18nClass: I18NService }),
provideNzConfig(ngZorroConfig),
Expand Down
Loading