I am using angular js to sort json data. everything is working fine but the part where empty or json with null data shows up right at top. Anyone has an example that pushes both empty and null data to bottom .
Example
{itemId: 42608125,
parentItemId: 42608125,
name: "Apple iPod touch 32GB, Assorted Colors",
salePrice: 237.49,
upc: "888462353151"
},
{itemId: 39875894,
parentItemId: 39875894,
name: "Griffin Survivor Extreme-Duty Case for Apple iPod touch 5G, Blue",
msrp: 29.88,
salePrice: 22.64
}
As you can see here one has msrp and other does not . SO when I order by msrp I see the one not having anything set at top.
<tr ng-repeat="u in ctrl.recommededResults | orderBy:'-productReview.reviewStatistics.averageOverallRating'">
<td><span ng-bind="u.itemId"></span></td>
<td><span ng-bind="u.name"></span></td>
<td><span ng-bind="u.msrp"></span></td>
<td><span ng-bind="u.productReview.reviewStatistics.averageOverallRating"></span></td>
</tr>