0

I have a table which is displaying nested ng-repeat values. The HTML looks like this.

<table class="table">
             <thead class="bgThead">
                <tr>
                    <th>Environment</th>
                    <th>Configurations</th>
                    <th>Servers</th>
                </tr>
            </thead>
            <tbody>
                <tr ng-repeat="environment in serverList.environments" ng-class-odd="''" ng-class-even="'dataTableOdd'">
                    <td>{{environment.Environment}}</td>
                    <td ng-repeat="servertypeinfo in environment.ServerTypeInfo">{{servertypeinfo.Type}}</td>
                    <td ng-repeat="servertypeinfo in environment.ServerTypeInfo">
                        {{servertypeinfo.ServerConfigInfo.length}}

                        <td ng-repeat="servers in servertypeinfo.ServerConfigInfo">{{servers.ServerName}}</td>
                    </td> 
                </tr>
            </tbody>
        </table> 

Now, when there are multiple values in child ng-repeat, the TDs are getting repeated, instead I want the whole row to be repeated, with the same values, except the new children value. Same goes with further nested ng-repeats. I made a plunk which shows what I am aiming for.

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

0

2 Answers 2

1

Example without table, may not be what you are looking for

<div class="form-group" ng-repeat="environment in serverList.environments track by $index">
    <div class="col-md-4">
        <span ng-bind="environment.environment"></span>
    </div>
    <div class="col-md-8">
        <ul class="list-group">
            <li id="{{$index}}" ng-repeat="servertypeinfo  in environment.serverTypeInfo track by $index">
                Server Type: <span style="font-size: 16px;" class="no-margin" ng-bind="servertypeinfo.type">{{servertypeinfo.serverConfigInfo.length}}</span>
                <p class="no-margin" ng-repeat="server  in servertypeinfo.serverConfigInfo">
                    Server Name: {{server.serverName}}
                </p>
            </li>
        </ul>
    </div>
</div>
Sign up to request clarification or add additional context in comments.

Comments

0

use the format like this

 <tbody>
  <tr ng-repeat="environment in serverList.environments" ng-class-odd="''" ng-class-even="'dataTableOdd'">
     <td>
       <table>
         <tr ng-repeat="servertypeinfo in environment.ServerTypeInfo">
            <td>{{environment.Environment}}</td>
            <td>{{servertypeinfo.Type}}</td>
            <td>
                {{servertypeinfo.ServerConfigInfo.length}}

                <td ng-repeat="servers in servertypeinfo.ServerConfigInfo">{{servers.ServerName}}</td>
            </td> 
         </tr>
       </table>
     </td>
  </tr>
</tbody>

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.