my ajax call

var PojedinacniPageController = function ($scope, $http, $routeParams) {

    $scope.contactID = $routeParams.covikId;

    var odgovor = $http.post('/Home/GetContact', $scope.contactID);
    odgovor.success(function (data, status) {
        $scope.kontakt = data;

    });
    odgovor.error(function (data, status) {
        alert(status);
    });
}

PojedinacniPageController.$inject = ['$scope', '$http', '$routeParams'];

mvc 4, HomeController, GetContact action:

        [HttpPost]
    public ActionResult GetContact(int kontaktID)
    {

        var kontakt = _db.Kontakti.Find(kontaktID);
        return Json(kontakt, JsonRequestBehavior.AllowGet);

    }

Not working, error 500. Please help

Related posts

Recent Viewed