ASP.NET Core 2 with Angular doesn't come with Angular Universal so now there are 3 app.module files in Angular. I am able to use them and I know the differences among these app.modules (server, browser and the standard one). However I am curious if there is a valid technical or non technical reason why did MS chose to abandon Angular Universal (when creating new standalone Angular project from Angular CLI it uses Angular Universal so it looks like only MS is doing it differently).
-
ASP.NET Core and Angular Universal fill the same role (they are HTTP servers), why would you need both?Pace– Pace2017-12-19 17:21:33 +00:00Commented Dec 19, 2017 at 17:21
-
well I think that there is some reason for it... from official Angular Universal website: Angular Universal was originally built to work with a node.js back-end. There are adapters for most popular node.js server-side frameworks such as Express or Hapi.js. In addition to node.js, however, Angular Universal has ASP.NET Core support. In the near future we hope to add support for Java, PHP and Python.David Szorad– David Szorad2017-12-19 18:23:12 +00:00Commented Dec 19, 2017 at 18:23
-
You are correct, I misunderstood its purpose.Pace– Pace2017-12-19 21:36:30 +00:00Commented Dec 19, 2017 at 21:36
Add a comment
|
1 Answer
Rendered components on page 1 60 600 1800
.NET – response (ms) 9 15 42 113
Express (NodeJS) – response (ms) 5 9 33 99
.NET slower by 80% 67% 27% 14%
.Net with Angular Universal use node for render server-side HTML page and I don't recommend use .net with Angular Universal.
I recommendation use a .net core WEB API and Angular Universal(Node.js)