Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET MVC (Razor) vs Angular 5

We are currently considering moving from ASP.NET MVC to Angular 5, mostly because it seems like the best and latest framework. However none of us seems to be able to come up with hard reasons on why Angular is better than MVC (Razor).

SPA vs MPA seems like different approaches with neither really being better - just better at different things.

Are there any resources/comparisons with hard benefits between the two?

Update: Almost 2 years after moving to Angular 4 (currently 7) I can say that it was a great decision. Angular makes it super easy to write quite complex front-end applications and the tooling around Angular itself, TypeScript, Karma + Jasmine (unit test frameworks) is fantastic. SPA is a huge step ahead of MPA in my opinion - we can finally have fluid web experience. I never really liked Razor and the whole mess around ajax/jquery, but I can comfortably say that I am really enjoying my time now! .NET CORE 3 + Angular 7 gives us everything we need!

To anyone thinking of taking the plunge, I would strongly recommend Angular (might as well start with 8 or 9, which is current at the time of writing this).

Happy to add more details if people want them :)

like image 465
Ross Avatar asked Apr 12 '18 05:04

Ross


People also ask

Which one is better Angular or ASP.NET MVC?

It's fairly simple: angular is perfect for web apps and . net mvc is a good choice for any public facing websites (e.g. when SEO is important). It all depends on the needs of what is better. It would be easier to suggest if scope/purpose would be explained.

Is Razor better than Angular?

The model-binding aspects of Angular we found to be a gigantic advantage of server-side rendering. Using Razor(or server side rendering in general) does, however, lend itself to better overall integrity as far as data goes and it makes for a better transition of data from front-end to back-end.

Which is better Razor or MVC?

From the docs, "Razor Pages can make coding page-focused scenarios easier and more productive than using controllers and views." If your ASP.NET MVC app makes heavy use of views, you may want to consider migrating from actions and views to Razor Pages.

Is ASP.NET MVC 5 outdated?

Is the framework outdated? ASP.NET MVC is no longer in active development.


1 Answers

6 months on from moving from ASP.NET MVC to Angular 5 (now 6) and we are extremely happy with the decision. .NET core backend and Angular frontend is a fantastic combination. It is so much cleaner and easier to create re-usable, strongly-typed, testable and easy to modify UI components!

For anyone considering if it's worth taking the plunge - I would say a resounding 'yes'!

like image 82
Ross Avatar answered Sep 23 '22 09:09

Ross