Ich habe eine Aktion-Methode in der Steuerung konvertieren, die als json Ergebnis zurückgibt:Wie json Datum von Winkel in asp.net Mvc
public ActionResult GetByDids(int id)
{
AngularMVCEntities _db = new AngularMVCEntities();
var emps = _db.Employees.Where(x => x.Did == id).ToList();
return Json(emps, JsonRequestBehavior.AllowGet);
}
und einen Code in Winkel js wie:
app.controller('employeesController', function ($scope, $http) {
$scope.GetEmployeesByDid = function (did) {
alert('Get Employees By Id' + ' ' + did);
$http.get('/Employees/GetByDids', { params: { id: did } }).then(function (response) {
$scope.Emps = response.data;
});
};
});
Wie konvertiert man das JSON DATE in String?
Sie müssen die relevanten Datumsinformationen aus diesem Zeichenfolgenwert extrahieren und verwenden, um ein Date-Objekt nach Bedarf zu erstellen. Siehe http://stackoverflow.com/questions/42074532/issue-with-datetime-jquery-asp-net-mvc/42075212#42075212 – Shyju
[ASP.NET MVC JsonResult Datumsformat] (http://stackoverflow.com/) Fragen/726334/asp-net-mvc-jsonresult-datumsformat –