mardi 12 septembre 2017

Ember.js, Looping through two array's with loops

I'm using Ember.js and I’m building a dynamic table. Essentially a user uploads a TSV file and I display the data in a table. However the format of these files are not uniform, they will be different every time, so I cannot hard code the column names. Right now I have an array of column names and I also have the array of objects with the data from the TSV file. Is it possible with Ember to use two loops to display the data? My issue is in the second loop I cannot use dot notation or brackets with the second looping variable. Is there an ‘ember way’ solution to this common problem?

<table class="table">
    <thead>
    <tr>
        
            <th></th>  
        
    </tr>
    </thead>
    <tbody>
        
            <tr>
                
                    <td></td>  <!-- doesn't work -->
                    <td></td> <!-- also doesn't work -->
                
            </tr>
        
    </tbody>
</table>




Aucun commentaire:

Enregistrer un commentaire