0

I want to show an array which is formed by other arrays. This is the array:

[{
    "net": "192.168.1.1/28",
    "_id": "531d179acacc4a8115530c0e",
    "ips": [{
        "ips": "192.168.1.1",
        "_id": "531d179acacc4a8115530c0f"
    }]
}, {
    "net": "192.168.1.1/24",
    "_id": "531d1c2d857831021c48e3af",
    "ips": [{
        "ips": "192.168.1.1",
        "_id": "531d1c2d857831021c48e3b3"
    }, {
        "ips": "192.168.1.33",
        "_id": "531d1c2d857831021c48e3b2"
    }, {
        "ips": "192.168.1.38",
        "_id": "531d1c2d857831021c48e3b1"
    }, {
        "ips": "192.168.1.106",
        "_id": "531d1c2d857831021c48e3b0"
    }]
}]

I did two loops (one inside the other) with ng-repeat but the second loop doesn't show anything, do you know why? Can you help me? This is the code.

Thank you very much.

 <li ng-repeat="data in networks">
    Red <a href="#/ip/{{data._id}}">{{data.net}}</a> 
        <lu>
           <li ng-repeat="ip in data">{{ ip }}
            Red <a href="#/ip/{{ip._id}}">{{ip.ips}},,</a></li>
            </li> 
        </lu>
    </li>
2
  • you have lu tags instead of ul, though that won't matter. Commented Mar 10, 2014 at 16:12
  • O.O Thank you very much! I wrote "lu" by mistake. Commented Mar 10, 2014 at 16:31

1 Answer 1

3

your inner array is in data.ips so you have to iterate over that

 <li ng-repeat="ip in data.ips">
Sign up to request clarification or add additional context in comments.

1 Comment

Thank you! The trouble was that I wrote "lu" instead of "ul", and I think it was other reason to not show it, because I had that mistake.

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.