❔ Implement Angular in existing ASP.NET Core MVC project?
Hi,
I have an ASP.NET MVC web app that takes a file upload in and produces an output. It uses Razor, HTML and some simple javascript in a <script> tag.
I would like to recreate the project in Angular, React, Vue and lastly Blazor (instead of js) to test each framework out and see which one I like the best.
I am currently trying to implement Angular, but I believe my web app uses server side rendering (SSR) as it uses ASP.NET Core MVC pattern.
My question is: how do I implement Angular in my existing ASP.NET MVC project ?
My question is: how do I implement Angular in my existing ASP.NET MVC project ?
13 Replies
First and foremost, you'll need some API controllers
Then make an Angular/Vue/React/Svelte/Qwik/Solid/Blazor app separately
And have it connect to the API
Hi @Angius . I do have some API controllers
In fact one of them takes a file upload and processes it, then outputs json data to the HTML using Razor
I would like to implement Angular in this app preferably, instead of creating an API (seems hard to reimplement as an API?)
uh
You need an API for Angular to be able to pull data from somewhere and to send data somewhere
You can't really mix MVC SSR with frontend frameworks
Ok, I see
Because the way I'm doing it right now is:
@model IEnumerable<MyObject>
Through razor
Then I'm processing the data from the Model
Yeah, because you use SSR there
Ok. Cool, I get it
Angular/Vue/Whatever app can, however, be completely separate from the backend
And one last question...
The backend can be hosted on Digital Ocean, and the frontend on Cloudflare Pages or something
Is it straightforward to reimplement the file upload as a webapi instead of an MVC app? Currently am using an IFormFile as a parameter in the controller @Angius
Yeah
You'll just need to send
multipart/form-data
type request instead of json
Ok
Cool thank you man!
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.