I am currently working on an $http call in my project:
$http({
method: 'GET',
url: '/api/PhotoSubmit/GetCategories',
accept: 'application/json'
})
.success(function (result) {
$scope.categories = result;
});
... that requires sending a parameter to this HTTPGET method :
[Route("api/PhotoSubmit/GetCategories/{id}")]
[HttpGet]
public object GetCategories(int id)
{
return FileServices.GetCategoriesForUser().Select(c => new { Id = c.Id, Name = c.Name });
}
The routing is set up correctly but I'm unsure of how to access it using Angular/JavaScript to send data to the controller (OR... how the route-call should be formatted in the $http call)
The URL for reference is:
http://localhost:63203/Index.html#/photosubmit/1