I referred https://github.com/angular/universal-starter and have implemented in angular5.server side rendering is not working after hosting in iis.It is fine in localhost:4000
Thanks
To implement server side rendering in your Angular application, you can use the Angular Universal package.
This error can be caused by a reference to the Window object if you are rendering your application from a server like Node. js. I will share how I have solved this issue, in my case this was caused by HammerJS which does not support server-rendered applications.
Angular applications are client-side applications that execute on the browser - which means they are rendered on the client, not on the server. You can add server-side rendering to your app using Angular Universal.
Use JavaScriptServices
for ASP.NET
. It provides:
Microsoft.AspNetCore.SpaTemplates plugs into dotnet new, providing project templates for Angular 2, Aurelia, Knockout, React, and React+Redux applications. Microsoft.AspNetCore.SpaServices is how SpaTemplates-produced projects work internally. It provides useful features for SPA applications, such as server-side rendering for Angular and React applications, plus integration with Webpack build middleware. Microsoft.AspNetCore.NodeServices is how SpaServices works internally. It’s a low-level library that gives a fast, robust way for ASP.NET Core applications to run arbitrary JavaScript code on the server.
TUTORIAL
#Server-side-prerendering
aspnetcore-angular2-universal. After running it,I got Child compilation failed error
@kamalav, I tested it locally.
Requirements: Make sure you have at least Node 6.x or higher (w/ npm 3+) installed! This repository uses ASP.Net Core 2.0, which has a hard requirement on .NET Core Runtime 2.0.0 and .NET Core SDK 2.0.0. Please install these items from here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With