For page navigation in asp.net MVC application with Angular.js, shall we use only angular.js routing or go to server for new page using asp.net MVC controller.
-
Try to look here: - http://stackoverflow.com/questions/23682203/how-to-use-asp-net-mvc-and-angularjs-routing – J. Petersen Mar 31 '16 at 13:23
2 Answers
I personally like to just use MVC to serve the default AngularJS files and then let Angular's routing handle the navigation within the application.

- 10,223
- 5
- 53
- 95
It depends on how you have designed the application architecture and communication.
Primarily, if you are using the ViewResult
result type from the Action methods then you will have to use the MVC routes.
Understand that angularjs $routeProvider
enables client side routing only and is not the same as MVC (server side) routes.
You use the $location
object to capture the URL changes to the address bar and the request is captured by the angular route (before it gets a chance to fire towards the server) and the configured template and controller are served.
Hope you understand that you then would (generally) use the $http
service to fire asynchronous calls to the respective actions on the server that WILL make use of the MVC defined routes too.
Logically, group related sections of your application using template-type routing on the angular side and more generalized routes on the server side.
Check out the mechanics in another post here.
Hence, like I said, it really depends on your design.