order - AngularJS orderBy with named elements -


so, have json named frutas showed below. angularjs orders automatically fruit name, need ordered 'order'. when try order with:

ng-repeat="fruta in frutas | orderby:'order'"  

i no result. why? how can fix that?

{ cacau: {cod: 2244, order: 3}, abacaxi: {cod: 18967, order: 2}, bacuri: {cod: 124, order: 1}, } 

orderby expects array operate with. https://docs.angularjs.org/api/ng/filter/orderby

if

{    cacau: {cod: 2244, order: 3},    abacaxi: {cod: 18967, order: 2},    bacuri: {cod: 124, order: 1}, } 

is frutas contains reason why orderby not working. please modify data in such way array, because @ moment object.

you can test if data array array.isarray() method.


Comments

Popular posts from this blog

How to provide Authorization & Authentication using Asp.net, C#? -

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

How to use Authorization & Authentication in Asp.net, C#? -