mercredi 4 octobre 2017

How to sort an array values in `desc` in computed?

I have an model value, when i do the each iteration it works fine.

<ul>
            <li>See here : </li>
            
                <li>Balances is : </li>
            
        </ul>

But I require to sorted the value by desc way. so I use the computed method to do the desc the array.

    sortTenuresBy:['desc'],
    sortedTenures: Ember.computed.sort('selectedCreditCard.balances.tenures', 'sortTenuresBy'),
    maxTenure:Ember.computed(function(){
        return this.get('sortedTenures').get('firstObject');
    }),

But getting error as like this:

Assertion Failed: When using @each to observe the array 3,8,12,24, the array must return an object

how to fix this? please help me




Aucun commentaire:

Enregistrer un commentaire