title: Using nodes with parents instead of nodes with children in Angular UI Tree
body: <p>I'm using <a href="https://github.com/angular-ui-tree/angular-ui-tree" rel="nofollow">Angular UI Tree</a> to show a TreeView. To request all nodes to a REST API, I use restangular to return a list of nodes.</p>
  
  <p>But, Angular UI Tree uses this data structure:</p>
  
  <pre><code>[
    { 
      "id" : 1,
      "nodes": [
          {
              "id" : 11
          }
      ]
    },
    { 
      "id" : 2,
      "nodes": [
          {
              "id" : 21
          }
      ]
    }
  ]
  </code></pre>
  
  <p>And I want it to use:</p>
  
  <pre><code> [
     {"id" :1, parent : ""},
     {"id" :2, parent : ""},
     {"id" :21, parent : "2"},
     {"id" :11, parent : "1"}
   ] 
  </code></pre>
  
  <p>How can I do that on template?</p>
  
  <p>I'm using <a href="https://github.com/angular-ui-tree/angular-ui-tree#unlimited-nesting-html-view-or-templates-example" rel="nofollow">this</a>.</p>
  
  <p>Is there any other way to request an array of nodes and to use that in UI Tree where each node is a Restangular object?</p>