Although I am able to display my AngularJS JSON data in chrome, but for some reason I can not display it in firefox.
What I have tried:
I checked firefox console log but it displays me some no helpful logs. I'm pretty sure reading the console log is not the way to troubleshooting this problem.
here is my server side code in c sharp:
public JsonResult getData()
{
List<SelectListItem> l = new List<SelectListItem>();
l.Add(new SelectListItem { Text = "a", Value="b" });
l.Add(new SelectListItem { Text = "c", Value = "d" });
return Json(l, JsonRequestBehavior.AllowGet);
}
And here is my client side codes:
$http({
url: "home/getData",
dataType: 'json',
method: 'GET',
headers: {
"Content-Type": "application/json"
}
}).then(function success(response) {
$scope.Details = response.data;
}, function error(response) {
$scope.Details = response.statusText;
})
<ul>
<li ng-repeat="x in Details">
{{x.Text}}
</li>
</ul>