AngularJS add table row (TR) inside ng-repeat -

EDIT is a similar (or duplicate) Angular.js ng-repeat for multiple elements

-

I have a table whose rows are generated via ng-repeat:

<tr ng-repeat="(key, value) in rows"> 
    <td>{{a}}</td>
    <td>{{b}}</td>
</tr>

I would prefer to store it in a <table> tag, rather than several built-in blocks for various reasons.

How to add a new line just below each line, for example. pseudo code

[ somehow-repeat ng-repeat="(key, value) in rows"]
    <tr class="1"> 
        <td>{{a}}</td>
        <td>{{b}}</td>
    </tr>

    <tr class="1"> 
        <td colspan="2">
    </tr>
[ /somehow-repeat ]

as far as I know (worth checking), I cannot wrap TR inside another element. just chekced :( the table does not show if there is a "somehow-repeat" element, or

so - is there a way to add a new line even though it is in ng-repeat?

+4
source share
1 answer

- -:

<tr class="1" ng-repeat-start="(key, value) in rows"> 
    <td>{{a}}</td>
    <td>{{b}}</td>
</tr>

<tr class="1" ng-repeat-end> 
    <td colspan="2">
</tr>
+6

Source: https://habr.com/ru/post/1531846/


All Articles