{{history.ref...">

Angular ng-repeat inside ng-repeat does not work in table

I have the following

<tbody ng-repeat="history in orderHistory"> <tr> <td>{{history.reference_code}}</td> <div ng-repeat="items in history.orderedItems"> <td>{{items.product_description}}</td> <td>{{items.quantity}}</td> </div> <td> </tr> </tbody> 

it seems that the second ng-repeat does not work and {{items.quantity}} or elements. shows nothing.

any ideas?

When I just test it as if it works

 <div ng-repeat="history in orderHistory"> <div ng-repeat="items in history.orderedItems"> {{items.product_description}} </div> </div> 

but i really need this inside the table

I tried the following:

  <tbody> <tr ng-repeat="history in orderHistory"> <td>{{history.reference_code}}</td> <div ng-repeat="items in history.orderedItems"> <td>{{items.product_description}}</td> <td>{{items.quantity}}</td> </div> <td> </tr> </tbody> 

and still not working

+5
source share
1 answer

ADDITIONAL RESPONSE

http://plnkr.co/edit/x0ZxWSy6JN3fo961NbQX?p=preview

The following should help you.

  <table ng-controller="myCtrl"> <tbody> <tr ng-repeat="history in orderHistory"> <td>{{history.reference_code}}</td> <td ng-repeat-start="items in history.orderedItems"> {{items.product_description}}<//td> <td ng-repeat-end>{{items.quantity}}</td> </tr> </tbody> </table> 

OLD ANSWER ----- The saved previous answer is retained for historical reasons due to comments. The problem is that it does not recur. I had a similar problem with <p> , like what you see here.

Here is the fiddle http://jsfiddle.net/yogeshgadge/02y1jjau/1/ where it works - that is changed to a div.

Here is one demo where it doesn’t work http://jsfiddle.net/yogeshgadge/2tk3u7hq/4/

Nested ng-repeat

Try this - move ng-repeat to <tr>

 <tbody> <tr ng-repeat="history in orderHistory"> <td>{{history.reference_code}}</td> <div ng-repeat="items in history.orderedItems"> <td>{{items.product_description}}</td> <td>{{items.quantity}}</td> </div> <td> </tr> </tbody> 
+5
source

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