0

We have started to implement AngularJS in our web-applications using ASP MVC. I am wondering what approach to use for building application in the future.

Keep using our current stategy: Build the website and provide the pages with ASP MVC. Authentication and authorization is provided out of the box by MVC.

Possible new strategy: Provide a the web pages through a normal website and put all the request behind a WebAPI.

Any toughts or other suggestions?

1

Using ASP.Net MVC for its authentication and authorization capabilities is perfectly fine. If you're using Angular, you will almost certainly also be using Web API to get the data into the templates (see note below), and you will probably want to reuse the same authentication and authorization code and capability on that side. Remember that this level of checking must happen on the server (and optionally on the client side).

A quick note: it's not 100% clear from your question whether you are suggesting combining MVC's templating capabilities with Angular's. Hopefully not, as this doesn't seem to make a lot of sense (unless you really need to be dynamically generating Angular templates), and you will likely end up with the worst of both worlds. So in a situation where both are used, the MVC part should only be serving up the Angular templates, and Angular doing what it's good at by combining it with data it pulls via Web API.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.