Angular 19 - hybrid rendering when using modules

Discussão em 'Angular' iniciado por Sparrow_ua, Março 24, 2025.

  1. Sparrow_ua

    Sparrow_ua Guest

    I'm trying to configure hybrid rendering for Angular 19 app.

    Majority of paths should be SSR'ed, however certain have to be client-side rendered, so I was trying to leverage hybrid rendering.

    Application still uses modules, so I was not being able to find any references how to configure that for module-based apps. Can anyone please help. Here's a project structure and AppServerModule

    src
    ├── app
    │ ├── app.component.html
    │ ├── app.component.ts
    │ ├── app.module.server.ts
    │ ├── app.module.ts
    │ ├── components
    │ ├── models
    │ └── services
    ...
    ├── index.html
    ├── main.server.ts
    ├── main.ts
    ├── polyfills.ts
    ├── server.ts
    ├── styles.css
    ├── tsconfig.app.json
    ├── tsconfig.server.json
    └── tslint.json


    app.module.server.ts

    import { NgModule } from '@angular/core';
    import { ServerModule } from '@angular/platform-server';

    import { AppModule } from './app.module';
    import { AppComponent } from './app.component';

    @NgModule({
    imports: [
    AppModule,
    ServerModule,
    ],
    bootstrap: [AppComponent],
    })
    export class AppServerModule {}

    Continue reading...

Compartilhe esta Página