ASP.NET MVC and Angularjs together + ASP.NET Web API

前端 未结 4 1691
后悔当初
后悔当初 2020-12-14 11:41

I would like to know the advantages and disadvantages of using these 2 worlds:

  • ASP.NET MVC and Angularjs together(without razor, Angularjs will do the job).
4条回答
  •  Happy的楠姐
    2020-12-14 12:28

    One possible solution is to create a REST service using Web API and consume it with Angular-based front-end app (actually, it doesn't matter what kind of front-end technology you will choose — web, desktop, native mobile, etc). This is possible if everything is done with a REST API, including authorization and authentication (bearer tokens is a good choice for that).

    In this scenario, your web server will simply act as a host for Angular views. It does not matter whether you'll use pure HTML with ng- attributes, MVC or even old-fashioned WebForms, because no mark-up will be generated dynamically on the server — Angular will perform all the required DOM manipulations on the client-side.

提交回复
热议问题