title: How to get the id from all children on Angular-tree-component?
body: <p>I'm using Angular-Tree-Component to display a tree view on my application. But once on a node I need to get the list of all children under that node and their children too.</p>
  
  <p>I saw that they have a function on their documentation doForAll that is invoked for every node under the node I'm in. </p>
  
  <p><a href="https://rawgit.com/500tech/angular-tree-component/master/doc/interfaces/_api_.itreenode.html#doforall" rel="nofollow noreferrer">https://rawgit.com/500tech/angular-tree-component/master/doc/interfaces/<em>api</em>.itreenode.html#doforall</a></p>
  
  <p>I can call that function and it works fine when I do a console.log, but when I try to push the ID of my node to my array I only get the first element.</p>
  
  <pre><code>  getChildren(node: TreeNode) {
       node.doForAll((data) =&gt; {
           console.log(data.id);
           this.guideArray.push(data.id);
       });
       console.log(this.guideArray);
    }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/gGfqL.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gGfqL.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/Fijzm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Fijzm.png" alt="enter image description here"></a></p>