2

I am confused in a scenario for my upcoming project.

The project has web API's written which can be called by web-apps or mobile apps.

I want to make a webapp using Angular2 for which I can see two approach
a. Use only Angular2 with Angular CLI and consume web api's
b. Use Angular2+Asp.net MVC5 together and consume web api's

both will end in making same thing but is there any advantage of one over another.

Here's is an image describing what I want to say enter image description here

Suraj Rao
  • 29,388
  • 11
  • 94
  • 103
BlackHat
  • 189
  • 2
  • 2
  • 11
  • 1
    My opinion is to go with the 'a' approach. Mixing server side languages with the angular 2 would be overkill for development. Especially if you'll go with the webpack files chunk. Go with the Angular 2 and REST API and you're good. – Igor Janković Feb 22 '17 at 11:22

1 Answers1

0

It all depends on your comfort level. You can go with first approach and care more about services and UI representation. You can take benefit of Typescript.

While in second case, if you are comfortable with razor view engine and then you can plug razor as your view engine for Angular. Also if you want to encapsulate your services then you can use controller and view model too. You can also take benefit of testability of MVC without hitting actual services that you can do in JavaScript also for angular.

Again all comes back to your comfort level and what sort of granularity you need.

Define your parameters to choose from scalable, maintainable, easy to learn, easy to deploy , easy to test.

Amit
  • 882
  • 6
  • 13