I'm using Ionic 1 with angular js.
I need to sort a result by a field that should be created later, the field is the distance from the first address of the company, in orderBy I do not know what to put, and also the object is not being generated correctly.
Or something that reorders the list right after the generation of the same.
Obs. I do not want to order the addresses within the company, I want to order the companies taking into consideration only the distance of the first address of each company. This distance will be calculated with the data taken from the user's GPS.
I made a JsFiddle that shows the situation