Srinivasan K K

Srinivasan K K

  • NA
  • 904
  • 188.5k

ASP.NET MVC with AngularJS

May 2 2015 2:12 AM
I have been doing with ngRoute. I've SPA which having 2 tabs clicking on each tab we show partial as html, but I'm experiencing issue while navigating from one tab to another tab when use like below.

angular.module('sam').config(function($routeProvider){
$routeProvider.when('/main/customer',{
templateUrl:"customer.html",
controller:"customerController"
})
.when('/main/client',{
templateUrl:"client.html",
controller:"clientController"
});
});

the above line kept it as separate file called app.js, Here I use ASP.NET MVC as backend, so from index.cshtml I did like below

<a href="/main/customer">Customer</a>
<a href="/main/client">Client</a>

I am experiencing an issue with above coding. But in angular ngRoute the second / looks for routeParams???that's why I'm getting error??

Can anyone help me in this.

Answers (2)