Search Posts

Category: sorting

Angularjs: How to order an array based on a child array of object’s Date field

I’ve got an array of arrays of objects that has the following structure: parentArr = [ [{id:1, date:1505020200000}, {id:4, date:1505020200000 }], [{id:2, date:1504681500000}], [{id:3, date:1504671000000}, {id:20, date:1504671000000}] ] Each child array will only contain dates that are the same. What I’m trying to do is use angular’s orderBy filter to to order the dates from oldest to newest, but I’m unsure of how to do it. I’ve tried setting the orderby filter to a variable […]