title: Angular 2 pipe to filter grouped arrays
body: <p>I have a group of arrays on my Angular2 app that I use to build a grouped list with <code>*ngFor</code> in my view:</p>
  
  <pre><code>[
    {
      category: 1,
      items: [{ id: 1, name: "helloworld1" }, { id: 2, name: "helloworld2" }]
    },
    {
      category: 2,
      items: [{ id: 3, name: "helloworld3" }, { id: 4 }]
    },
    {
      category: 3,
      items:[{ id: 5 }, { id: 6 }]
    }
  ]
  </code></pre>
  
  <p>I also have a boolean that when it's true should filter only the items that have the <code>name</code> property. If a group does not have any item that matches this condition it should not pass. So the result would be the following if the boolean is true:</p>
  
  <pre><code>[
    {
      category: 1,
      items: [{ id: 1, name: "helloworld1" }, { id: 2, name: "helloworld2" }]
    },
    {
      category: 2,
      items: [{ id: 3, name: "helloworld3" }]
    }
  ]
  </code></pre>
  
  <p>How can I implement a pipe to achieve this kind of result?</p>