jeudi 21 septembre 2017

How to collect sub arrays are new Arrays using `computed` method?

I have a list of array. which contains sub arrays. how to collect those arrays and return as new array?

here is my try but not works:

transactions:Ember.computed.map('model.cardList', function(card, index ){
        return card.get('transactions');
    },[]), //collecting all sub arrasy but not works!!
    sortedCards:Ember.computed(function(){
        return this.get('model.cardList');//length 4 
    }.property([])),

What is the correct way to collect the sub arrays from parent arrays? it requrie for sorting purpose.

Thanks in advance.

trying here, but nothing works: Twiddle




Aucun commentaire:

Enregistrer un commentaire