私は$http.get()
の結果をループするng-repeat
要素を持っています。角度JS日付フィルタが機能しない
<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>
私は、MySQLデータベースのテーブルにtimestamp
としてcreated_at
を持っています。そして私はangular.js v1.0.7
を使用しています。
dbテーブルから同じ出力が得られていて、フィルタが機能していません。これをどうすれば解決できますか?
私のAJAX呼び出し、
$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 = [];
});
私はなぜそれを使うべきではないのですか? – Vignesh
@Vigneshはい、私はそれを利用すべきです。 – devo