Trying to pass a dictionary from JS to MVC with no success. The data (reportIdAndStatus in mvc controller) is null.
I'm using angular $resource and MVC 3. Thanks.
Angular Controller:
var reportStatusdictionary = {};
//build a dictionary
for (var x = 0; x < reports.length; x++) {
reportStatusdictionary[reports[x].Id] = reports[x].StatusId
}
reportsService.getReportStatusComment({ reportStatusdictionary: reportStatusdictionary }
Angular Resource Definition:
getReportStatusComment:
{
method: 'GET',
params: { reportIdAndStatus: '@reportIdAndStatus', command: 'GetReportStatusComment' },
isArray: false
}
MCV Controller:
[HttpGet]
public string GetReportStatusComment(Dictionary<Guid, int> reportIdAndStatus)
Request In Browser:
