0
I am using Ionic 1 with Angularjs.
I need to sort a result by a field that should be created later, the field is the distance from the first company address, in orderby do not know what to put, and also the object is not being generated correctly.
Or something that rearranges the list right after the generation of it.
Obs. I do not want to sort the addresses within the company, I want to order the companies taking into account only the distance from the first address of each company. This distance will be calculated with the user’s GPS data.
I made a Jsfiddle that shows the situation
Your problem is in orderby, there is no way it sort why you are passing an invalid value, for the distance field to work, must be in ngRepeat addresses. https://jsfiddle.net/6dg105q8/3/
– Diego Vieira
because, that’s the problem, I don’t want to sort the addresses inside the company, I want to order the companies taking into consideration only the distance of the first address of each company.
– Carlos Fagiani Jr
I think I’ve solved your problem, take a look. https://jsfiddle.net/6dg105q8/4/
– Diego Vieira
Boy, that’s right, ng-init worked, put as a solution for me to give you the points.
– Carlos Fagiani Jr