locked
Benefits of using ASP.NET/MVC with a SPA Angular 2 app? RRS feed

  • Question

  • User2051039772 posted

    What do you gain by using ASP.NET/MVC, if you are developing a purely Single Page Application using Angular 2?

    E.g. I've seen various tutorials about using Visual Studio Code and Angular 2.0 that does not leverage the ASP.NET framework at all.

    Monday, June 5, 2017 7:37 PM

All replies

  • User1967761114 posted

    Hi daniel-bolton,

    Benefits of using ASP.NET / MVC with a SPA Angular 2 app?

    I think you'd better ask for in which scene is better using MVC + SPA Angular2 app.

    I suggest when the requirements doesn’t very complicated, you could using it, you could know, that’s will always make things to be more complicated when you want to integrate all features into one page, even you using angular 2 by components.

    What do you gain by using ASP.NET/MVC, if you are developing a purely Single Page Application using Angular 2?

    Angular applications are made up of components, that’s only run on the browser(client), when you want to access the server(such as access database, file and so on),you could using C# to implement it.

    If you have any other questions, please feel free to contact me any time.

    Best Regards

    Even

    Tuesday, June 6, 2017 5:34 AM
  • User-474980206 posted

    if you are writing an SPA app, often it has to call the server (ajax calls). you can write the server code in MVC, typically as an api controllers. the only advantage of using a razor view to return the index page, is you can initialize a json object on the page and save an ajax call.

    a better approach is a true n tier application.

      ui-tier: webserver - use node.js to host so you can pre-render angular pages. could also use asp.net/mvc with spa-services.
      middle-tier: asp.net/mvc - use to call data tier and backend services

    Thursday, June 8, 2017 12:34 AM