I'm trying to set up a project in Asp.Net 4.5.2 (VS2017) with Angular 4.
All examples seem to use Asp.Net Core, but we're trying not to jump into .NET Core just yet, if possible.
We would like to have server side rendering though, samples seem to use this asp-prerender-module
attribute from "Microsoft ASP.NET Core JavaScript Services".
Is it possible to render angular 4 server side with MVC 5?
To load Angular in ASP.NET MVC, include the script references of Angular core modules and Syncfusion JavaScript asset files in _Layout file , and load the component in index. cshtml like the following code snippets.
Angular Universal executes on the server-side by generating static pages and later are sent to the client browser for display. Thus, Angular Universal renders the app more quickly and allows users to view the application's layout.
ASP.NET Core MVC is a server-side MVC framework. In a server-side application the client's request to view a page depends on the server delivering the correct content for that specific page (HTML, CSS, files, etc.) to the client. The client then renders this content for the user.
The updated Angular project template provides a convenient starting point for ASP.NET Core apps using Angular and the Angular CLI to implement a rich, client-side user interface (UI). The template is equivalent to creating an ASP.NET Core project to act as an API backend and an Angular CLI project to act as a UI.
Officially there is no Asp.Net Framework (non Core) support.
As stated in https://universal.angular.io/overview/:
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
EDIT: "Microsoft ASP.NET Core JavaScript Services" only supports ASP.NET Core which means the site needs to deployed ASP.NET Core style. But this all can run in .NET 4.5.2 so you can still reference your good old .NET Framework libraries in your project.
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