I'm using angularjs inside my asp.net mvc project and have the folowing link in the asp.net view:
<a href="/Organization/Employee/@user.Alias#info">@user.Alias.ToUpper()</a>
that gives me a link like this for example:
http://localhost:53315/Organization/Employee/15#/info
Which I want to be hanled by mvc controller and then use angularjs routing to show template inside returned asp.net view.
Here's my asp.net mvc controller:
public ActionResult Employee(String id)
{
...
return View();
}
routeConfig:
context.MapRoute(
"Organization_Employee",
"Organization/Employee/{id}/{*mod}",
new { controller = "User", action = "Employee" }
);
and angularjs stuff:
$routeProvider
.when('/info', {
controller: 'UserCtrl',
templateUrl: baseTemplateUrl + 'info.html'
})
.controller('UserCtrl', ['$scope', '$location', '$routeParams', 'User', function ($scope, $location, $routeParams, User) {
$scope.user = User.get({ id: $routeParams.id });
How I can get that id
('15') parameter from url in angular controller?