I currently have an existing ASP MVC4 application that returns views (razor) from controllers and would like to start transitioning the application into a SPA (single page application) using web api and angular js. My question is can i slowly start transitioning specific views/urls to be routed by angular and have other views/urls call back to the legacy controllers in the MVC application that render razor views? For example I have my main angular js file stating the following
window.EcentralSPA = angular.module('EcentralSPA', ['ngRoute']);
EcentralSPA.config(['$routeProvider', function ($routeProvider) {
$routeProvider.when('/users', {
templateUrl: 'app/views/users.html',
controller: 'UsersController'
});
}]);
EcentralSPA.controller('UsersController', ['$scope', function ($scope) {
//TODO
}]);
Basically i'd just like the /users url to get handled by angular and the rest of the urls to call back to the web server to the correct mvc controller and render back the razor view. However with my current configuration above all calls to anything besides /users returns empty data. Any suggestions? Thank you.