Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to implement angular 4 server prerendering in ASP.NET Core

I'm upgrading a ASP.NET Core project from AngularJS to Angular 4. Now that Angular Universal (a community branch) has been integrated into Angular itself, I would like to experiment with server prerendering.

Server prerendering with Vue 2 and ASP.NET Core is pretty elegant (e.g. http://mgyongyosi.com/2016/Vuejs-server-side-rendering-with-aspnet-core/).

Are there any similar examples or tutorials about integrating Angular 4 server prerendering with ASP.NET Core, avoiding any refactoring from Angular Universal samples?

like image 570
Sigge Avatar asked Mar 25 '17 10:03

Sigge


1 Answers

Now we're a month further and MarkPieszak did an incredible job at putting together a starter template for exactly this: server prerendering of an Angular 4 app by using node.js on the server side.

I can now answer my own question by referencing this:

  • ASP.NET Core & Angular 4 with server-side prerendering

    This starter template runs a perfect example out of the box. It's well documented and more complete docs are on the current roadmap.

  • Angular AspnetCore Engine

    The heart of what makes server prerendering possible on ASP.NET Core. I has a decent readme to get started from scratch.

like image 167
Sigge Avatar answered Nov 15 '22 08:11

Sigge