Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recursive Template #184

Closed
andyfensham opened this issue Dec 21, 2015 · 3 comments
Closed

Recursive Template #184

andyfensham opened this issue Dec 21, 2015 · 3 comments

Comments

@andyfensham
Copy link

andyfensham commented Dec 21, 2015

Hi,
How would I be able to loop through a tree recursively. E.g. I have a tree that can go unknown length deep and I want to put the title into list items or div's with the id being the id of the element.

[
  {
    "id": 1,
    "title": "node1",
    "nodes": [
      {
        "id": 11,
        "title": "node1.1",
        "nodes": [
          {
            "id": 111,
            "title": "node1.1.1",
            "nodes": []
          }
        ]
      },
      {
        "id": 12,
        "title": "node1.2",
        "nodes": []
      }
    ]
  },
  {
    "id": 2,
    "title": "node2",
    "nodes": [
      {
        "id": 21,
        "title": "node2.1",
        "nodes": []
      },
      {
        "id": 22,
        "title": "node2.2",
        "nodes": []
      }
    ]
  },
  {
    "id": 3,
    "title": "node3",
    "nodes": [
      {
        "id": 31,
        "title": "node3.1",
        "nodes": []
      }
    ]
  },
  {
    "id": 4,
    "title": "node4",
    "nodes": [
      {
        "id": 41,
        "title": "node4.1",
        "nodes": []
      }
    ]
  }
]
@strrchr
Copy link

strrchr commented Jan 7, 2016

I just found this issue: #34
It shows a runtime recursion.

@houd1ni
Copy link

houd1ni commented Apr 20, 2016

feel free to reopen #191 due to maintain issues with this fork

@epoberezkin
Copy link
Collaborator

Also see #185

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants