Ich habe ein ng-repeat
Element, das durch $http.get()
Ergebnis durchlaufen wird.Angular JS Datum Filter funktioniert nicht
<tr ng-repeat="blog in posts">
<td style="text-align:center">{{ $index+1 }}</td>
<td>{{ blog.title }}</td>
<td>
{{ blog.author.name }}
</td>
<td>
{{ blog.created_at | date:'MMM-dd-yyyy' }}
</td>
</tr>
Ich habe created_at
als timestamp
in MySQL Datenbanktabelle. Und ich verwende angular.js v1.0.7
.
Ich bekomme die gleiche Ausgabe von db Tabelle und Datum Filter funktioniert nicht. Wie kann ich das lösen?
Mein Ajax-Aufruf,
$http({method: 'GET', url: 'http://localhost/app/blogs'}).
success(function(data, status, headers, config) {
$scope.posts = data.posts;
}).
error(function(data, status, headers, config) {
$scope.posts = [];
});
warum nicht eckig forEach – Vignesh
@Vignesh Ja, ich sollte das nutzen. – devo