I have the following json object:
"comments": [
{"username": "test", "comment": "This is a comment",
"child": [
{"username": "chriscool", "comment": "I replied to the above comment",
"child": [
{"username": "Anotherperson", "comment": "But what if I replied again",
"child": [
{"username": "ralphy", "comment": "And again?!" }
] }
] },
{"username": "ralphy", "comment": "I also replied" }
] }
]
As you can see, each comment could have a child
comment so it could literally go on forever. I am trying to display all of them but I can't figure out how I would do this.
This is all I have so far (obviously this only gets the first child in each comment):
<div ng-repeat="comment in comments">
{{ comment.comment}}
<div ng-repeat="c in comments.child">
{{c.comment}}
</div>
</div>