I have an array which I want to order by date in Angular.js:
{{er.pu
-
To make to orderBy
to work you need wrap string date with object of new Date(/**/)
in controller.
For example:
$scope.vm.readerFeeds = [
{
//.....
publishedDate: new Date(/*your string date*/);
},
{
//.....
publishedDate: new Date(/*your string date*/);
}
];
- 热议问题