mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
With the commit we mimic server-side behavior and serialize a bunch of transfer cache data. fixes #62664 PR Close #62665
49 lines
1.5 KiB
TypeScript
49 lines
1.5 KiB
TypeScript
/**
|
|
* @license
|
|
* Copyright Google LLC All Rights Reserved.
|
|
*
|
|
* Use of this source code is governed by an MIT-style license that can be
|
|
* found in the LICENSE file at https://angular.dev/license
|
|
*/
|
|
|
|
import {
|
|
ApplicationConfig,
|
|
provideZonelessChangeDetection,
|
|
provideAppInitializer,
|
|
} from '@angular/core';
|
|
import {provideRouter} from '@angular/router';
|
|
import {ApplicationEnvironment, ApplicationOperations} from '../../projects/ng-devtools';
|
|
|
|
import {DemoApplicationEnvironment} from '../demo-application-environment';
|
|
import {DemoApplicationOperations} from '../demo-application-operations';
|
|
import {serializeTransferState} from './transfer-state';
|
|
import {provideHttpClient, ɵwithHttpTransferCache} from '@angular/common/http';
|
|
|
|
export const appConfig: ApplicationConfig = {
|
|
providers: [
|
|
provideZonelessChangeDetection(),
|
|
provideHttpClient(),
|
|
provideRouter([
|
|
{
|
|
path: '',
|
|
loadChildren: () =>
|
|
import('./devtools-app/devtools-app.routes').then((m) => m.DEVTOOL_ROUTES),
|
|
pathMatch: 'full',
|
|
},
|
|
{
|
|
path: 'demo-app',
|
|
loadChildren: () => import('./demo-app/demo-app.routes').then((m) => m.DEMO_ROUTES),
|
|
},
|
|
]),
|
|
{
|
|
provide: ApplicationOperations,
|
|
useClass: DemoApplicationOperations,
|
|
},
|
|
{
|
|
provide: ApplicationEnvironment,
|
|
useClass: DemoApplicationEnvironment,
|
|
},
|
|
// We simulate a transfer state created by the server-side rendering.
|
|
provideAppInitializer(async () => serializeTransferState()),
|
|
],
|
|
};
|