1. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

Angular prerendered site flashing home page for non-prerendered routes

Discussão em 'Angular' iniciado por adam0101, Outubro 1, 2024 às 00:02.

  1. adam0101

    adam0101 Guest

    I have an Angular 18 site in which I implemented app-shell. In my angular.json I have "prerender": true and "ssr": false and when I run ng build, I can see the shell contents in the main index.html as expected.

    However, if I add a route for the homepage such as { path: '', loadComponent: () => import('src/app/dashboard/dashboard.component').then(x => x.DashboardComponent) }, then I see the prerendered content of dashboard instead of shell in the index.html. I believe this is why the dashboard content flashes for a moment for non-prerendered routes. How can I prerender the site including the homepage, but still have the shell display while loading deep links to non-prerendered routes?

    Continue reading...

Compartilhe esta Página