2

Can any one provide with a plunker or any hint on how to use http://angular-ui-tree.github.io/angular-ui-tree/#/basic-example

with a json object like this

var list = [
            {
              "id": 1,
              "title": "Parent",
              "items": [
                {
                  "id": 11,
                  "title": "child of Parent",
                  "items": [{
                      "id": 12,
                      "title": "inner child of Parent",
                      "items": [],
                    }],
                },

              ]
            }
        ]
1

2 Answers 2

1

We have a set of examples which can be seen on the website. You can view the data structure on the right hand side of every example.

See https://github.com/angular-ui-tree/angular-ui-tree/tree/master/examples

Sign up to request clarification or add additional context in comments.

Comments

0

Lets look at the block in question

<div ui-tree>
  <ol ui-tree-nodes="" ng-model="list">
    <li ng-repeat="item in list" ui-tree-node>
      <div ui-tree-handle>
        {{item.title}}
      </div>
      <ol ui-tree-nodes="" ng-model="item.items">
        <li ng-repeat="subItem in item.items" ui-tree-node>
          <div ui-tree-handle>
            {{subItem.title}}
          </div>
        </li>
      </ol>
    </li>
  </ol>
</div>

item.items is also an array.

You know because the li nested below it is an ng-repeat looping through the values in item.items as subItem.

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.