5

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?

2 Answers 2

8

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:

Sign up to request clarification or add additional context in comments.

2 Comments

Upvoted. Could you see my question? stackoverflow.com/questions/44306233/…
cannot understand how can I implement server side rendering using ASP.NET Core Web API and Angular 4. Please, see my question. Thanks in advance.
0

I have this package/showcase for angular 4 asp.net core, it does show up some kind of server prerendering but, angular structurally doesn't wanta server to worry about client view/page and just ask data from server.

with this controller you can cut and make your way: https://github.com/Longfld/ASPNETCoreAngular4/blob/master/webapp/src/webapp/Controllers/HomeController.cs

with this controller, angular only ask for data and leave view part to itself: https://github.com/Longfld/ASPNETCoreAngular4/blob/master/webapp/src/webapp/Controllers/StaffController.cs

https://github.com/Longfld/ASPNETCoreAngular4

2 Comments

Thanks for your answer, it will prove useful in other ways, but unfortunately not for the prerendering I'm after: I really would want the entire angular view to be prerendered on the server side in the same way Angular Universal did this. This was done by using node.js on the server and by implementing two boot files; one for the server, and one for the browser once it takes control of the DOM. I found a sample of a similar endeavor here, but this user also seems to be stuck.
Seems like JavascriptServices now has an issue open to upgrade to angular 4, it includes pre-server rendering. Keeping an eye on this one!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.