Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET MVC 5 vs. AngularJS / ASP.NET WebAPI [closed]

I'm currently evaluating the programming model for creating future Webapplications in my company. So I will decide between ASP.NET MVC 5 (with Razor Views) and AngularJS with ASP.NET WebAPI. What are the advantages / disadvantages of these two programming models?

like image 874
bitsmuggler Avatar asked Apr 15 '14 07:04

bitsmuggler


People also ask

Is Web API better than MVC?

There are many differences between MVC and Web API, including: We can use the MVC for developing the Web application that replies as both data and views but the Web API is used for generating the HTTP services that replies only as data.

Which one is better Angular or ASP.NET MVC?

Both ASP.NET MVC and AngularJS has their own purposes and advantages. As with your specific question, AngularJs is better for SPA (Single Page Applications), where as ASP.NET MVC is a full fledged server side Application which can contain WebAPIs, Routing engine as well as HTML emitting Views.

Is ASP.NET MVC discontinued?

ASP.NET MVC is no longer in active development. The last version update was in November 2018. Despite this, a lot of projects are using ASP.NET MVC for web solution development. As to JetBrains' research, 42% of software developers were using the framework in 2020.


2 Answers

My 2 cents. I personally prefer pure HTML views, an entirely angular front end along with a Web API/EF/SQL Server back end, basically no Razor. Razor is an abstraction to help programmers render HTML, these days everyone's coming to the conclusion that removing these abstractions is a better idea, hence the evolution of ASP.NET from web forms, to MVC etc. It's not really difficult for developers to get to grips with HTML and use an angular front end, moreover this makes UI designers jobs easier, they have pure HTML and JSON/Javascript, they don't need to go about understanding MVC, Razor, controllers and actions. We used to work completely on MVC, in our latest project we moved to a Web API back end and an angular front end, and we've noticed that our UI designer's productivity has vastly improved.

like image 136
Mohammad Sepahvand Avatar answered Oct 01 '22 16:10

Mohammad Sepahvand


I believe you cannot compare. AngularJS is a Single Page Application (SPA) framework whereas ASP.Net MVC use the standard model where one navigates between pages. Whether you want to build a SPA is decided by factors like

  • Do you want SEO. Which most of these JS rich framework have limited support.
  • How can you structure your app as SPA or multiple SPAs.
  • Coming from a type safe language C# to JavaScript programming is a challenge.
  • Learning AngularJS and using it effectively.

We use the standard MVC 5 razor view to setup the initial AngularJS views so you can even combine them together if required.

See this answer Can you use AngularJS with Parse.com? to derive more context.

like image 42
Chandermani Avatar answered Oct 01 '22 15:10

Chandermani