Den Versuch, Zeit in der Tabelle zu zeigen, aber es zeigt mir Zeit in diesem FormatAnzeige Span Typ Daten in AngularJS Listing
{"Hours":16,"Minutes":8,"Seconds":45,"Milliseconds":0,"Ticks":581250000000,"Days":0,"TotalDays":0.6727430555555556,"TotalHours":16.145833333333332,"TotalMilliseconds":58125000,"TotalMinutes":968.75,"TotalSeconds":58125}
, während ich es will
"12:13:20"
in Html in diesem Format angezeigt werden Datei i ist die Auflistung wie diese
<table>
<thead>
<tr>
<th>Start Time</th>
<th>End Time</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="item in Festivals">
<td>{{item.StartTime}}</td>
<td>{{item.EndTime}}</td>
</tr>
</tbody>
</table>
Angular Controller-Code, wo ich Daten am Initialisierung
var app = angular.module('myApp');
app.controller('SeasonCtrl', [
'$scope', '$http', 'seasonService', function ($scope, $http, seasonService) {
$scope.Seasons = [];
seasonService.GetAllSeasons = function() {
seasonService.getSeasons().success(function (data) {
$scope.Seasons = data.data;
})
}
seasonService.GetAllSeasons();
}
]);
C# Code Ich bin Daten Winkelregler
public JsonResult GetAllSeasons()
{
var data = _seasonManager.AllSeasons();
if (data != null)
{
var list = data.Select(r => new
{
r.StartTime,
r.EndTime
});
return Json(new { data = list }, JsonRequestBehavior.AllowGet);
}
return null;
}
Bitte Code hinzufügen. –
Können Sie uns den Wert von 'item.StartTime' zeigen? –
Dieser Wert stammt aus DB, wenn ich Objekt durch Knickpunkt überprüfen {Starttime = {14.44.45}, EndTime = {14.44.45}} während in Browser zeigt es in diesem Format { "Hours" : 16, "Minuten": 8, "Sekunden": 45, "Millisekunden": 0, "Ticks": 581250000000, "Tage": 0, "TotalDays": 0.6727430555555556, "TotalHours": 16.14583333333332, "TotalMilliseconds": 58125000 , "TotalMinutes": 968.75, "TotalSeconds": 58125} – Slan