MD GHOUSE MD GHOUSE - 3 months ago 8
AngularJS Question

Why table not showing nested ng-repat

How to show nested

ng-repeat
here my data is coming from database but why table not showing

<div ng-controller="MyCntrl">
<table class="table" >
<tr>
<th style="cursor:pointer;margin-left:5px;" ng-click="EmployeeeName"<b>Employee Id</b></th>
</tr>
<tr ng-repeat="Emp in John">
<td>
{{Emp.Name}}
</td>
</tr>
<tr ng-repeat="Joy in Emp.tblOrder" class="table">

<td>
{{Joy.OrderId}}
</td>
<td>
{{Joy.ProductID}}
</td>
</tr>
</table>
</div>

Answer

You are not using nested ng-repeat. You are having two separate ng-repeat.

See your question. You are having two separate ng-repeat. The ng-repeat is not nested at all.

<tr ng-repeat="Emp in John">
                <td>
                    {{Emp.Name}}
                </td>           
            </tr>
            <tr ng-repeat="Joy in Emp.tblOrder" class="table">

                <td>    
                    {{Joy.OrderId}}
                </td>
                <td>
                    {{Joy.ProductID}}
                </td>
            </tr>
Comments