title: AngularJS filter object by property on tree structure
body: <p>I am posting this because I never found a precise answer for filtering nested objects (tree sturcture).</p>
  
  <p>Let's say we have an JSON tree structure that looks like this:</p>
  
  <pre><code>$scope.tree = [{
      id: 1,
      parent_id: 0,
      name: 'Root Item',
      items: [
                {
                 id: 2, 
                 parent_id: 1, 
                 name: '1st Child of 1'
                },
                {
                 id: 3, 
                 parent_id: 1, 
                 name: '2nd Child of 1'
                },
                {
                 id: 4, 
                 parent_id: 1, 
                 name: '3rd Child of 1',
                 items:[
                     {
                      id:5, 
                      parent_id: 4, 
                      name:'1st Child of 5'
                      },
                     {
                      id:6, 
                      parent_id: 4, 
                      name:'2nd Child of 5'
                      }
                 ]}
             ]
      }]
  </code></pre>
  
  <p>How do we traverse the tree with a filter to <strong>get object with id 6</strong> for example?</p>