title: AngularJS - Filter search for all true values
body: <p>I have some data which generates an object of key value pairs in a nested fashion.</p>
  
  <p>It will generate an object like such:</p>
  
  <pre><code>$scope.selectedVals = {
      shape: {
          oval: false,
          rectangle: true
      },
      size: {
          large: false,
          medium: true
      }
  }
  </code></pre>
  
  <p>I would like to programatically use $filter to get only the values which are true. The result I'm looking for is:</p>
  
  <pre><code>var filtered = {
      shape: {
          rectangle: true
      },
      size: {
          medium: true
      }
  }
  </code></pre>
  
  <p>I tried using $filter as such, but no luck, I just get back the original object:</p>
  
  <pre><code>var filtered = $filter('filter')($scope.selectedVals, true);
                                   // the object        // the value to search
  </code></pre>
  
  <p>I know I could just iterate the object myself with a loop, but I'm looking for a way to use $filter if possible.</p>
  
  <p>Here is a plunker: <a href="http://plnkr.co/edit/t3FhSvLgyXE8A3jfxWG0?p=preview" rel="nofollow">http://plnkr.co/edit/t3FhSvLgyXE8A3jfxWG0?p=preview</a></p>