0

I have the following code:

<script type="text/ng-template" id="table_renderer.html">
    <tr>
    <td>{{node.partcode}}</td>
    <td>{{node.quantity}}</td>
    <td>{{node.listprice}}</td>
    </tr>
    <tr ng-repeat="node in node.components" ng-include="'table_renderer.html'"></tr>
</script>

<div>
    <table>
        <thead>
            <tr>Selected Components</tr>
            <tr>
                <td>Partcode</td>
                <td>Qty</td>
                <td>List Price</td>
            </tr>
        </thead>
        <tbody ng-repeat="node in data" ng-include="'table_renderer.html'"></tbody>
    </table>
</div>

The data contains nested data and this renders the table as required. Is there a simple way of converting this to csv format?

Edit: to clarify, the table rendered by this code is exactly what is required. Ideally, the resultant html would be converted to csv. The correct answer would either indicate that this is not possible, or a solution would be offered.

Terry
  • 785
  • 1
  • 8
  • 20

1 Answers1

0

you can choose one of these grid/table component to present your data. Each component should have its csv export feature.

My recommendation is ui-grid and here its export example

Community
  • 1
  • 1
asdf_enel_hak
  • 7,474
  • 5
  • 42
  • 84
  • I investigated ui-grid, but the requirement to represent nested data isn't neatly covered. The simple table does this, but I need to convert this table to a csv format. – Terry Aug 17 '15 at 19:17