Consider the following example,
var arrayOfObject = [
{name: 'ron', data: [1,3,5]},
{name: 'raj', data: [2,3]},
{name: 'roy', data: [1]}
]
In the view, I need to sort the objects in ascending order based on the length of data
array in each objects.
In the above example roy, raj, ron.
I could always loop through the array, find the length and sort it, But was wondering if there was a way to sort it using Angular's OrderBy Filter (view or controller).
Thanks,