1

I am trying to visualize an json-object in a table like this :

<div ng-repeat="item in data">
  <tr ng-repeat="i in item">
    <td>{{i.id}}</td>
    <td>{{i.ip}}</td>
  </tr>
</div>

If I do that I will see only a white screen.

This way works, but I need the data in an table.

<div ng-repeat="item in data">
  <ul ng-repeat="i in item">
    <div>
      {{ i.id }}
      {{ i.ip }}
    </div>
  </ul>
</div>

Do you know a possible solution with a table?

2 Answers 2

3

try this

 <table>
  <tbody ng-repeat="item in data">
  <tr ng-repeat="i in item">
    <td>{{i.id}}</td>
    <td>{{i.ip}}</td>
   </tr>
 </tbody>
 </table>
Sign up to request clarification or add additional context in comments.

1 Comment

look at my answer please.
0

I found the mistake! The first ng-repeat must be in the table statement.

    <table class="table table-striped">
        <thead>
            <tr>
                <td>id</td>
                <td >ip</td>
            </tr>
        </thead>

        <tbody ng-repeat="item in data">
                <tr ng-repeat="i in item">
                    <td>{{i.id}}</td>
                    <td>{{i.ip}}</td>
                </tr>
        </tbody>
    </table>

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.