title: Knockoutjs: how to filter a foreach binding without using if
body: <p>Is there a way to implement the statements below using a custom binding, to eliminate the if-binding:</p>
  
  <pre><code>&lt;div data-bind="foreach: $root.customersVM.customers"&gt;
      @Html.Partial("_Customer")
      &lt;div data-bind="foreach: $root.ordersVM.orders"&gt;
          &lt;!-- ko if: customer() == $parent.id() --&gt;
          @Html.Partial("_Order")
          &lt;!-- /ko --&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Or put it in another way: Does someone know <strong>Way 2</strong> in the answer to <a href="https://stackoverflow.com/questions/8869264/knockout-js-foreach-but-only-when-comparison-is-true">Knockout.js foreach: but only when comparison is true</a>?</p>