title: Aurelia get value conventer results in view
body: <p>I would like to get the result of value conventer that filters an array in my view in order to display the number of results found.</p>
  
  <pre><code>  &lt;div repeat.for="d of documents|docfilter:query:categories"&gt;
      &lt;doc-template d.bind="d"&gt;&lt;/doc-template&gt;
    &lt;/div&gt;
  </code></pre>
  
  <p>I neither want to move this logic to my controller (to keep it clean), nor to add crutches like returning some data from the value controller.</p>
  
  <h3>What I want:</h3>
  
  <p>So, basically I would like something like angular offers:
  Like shown <a href="https://stackoverflow.com/a/18593018/2044039">here</a>: 
  <code>ng-repeat="item in filteredItems  = (items | filter:keyword)"</code>
  or <a href="https://stackoverflow.com/a/32960240/2044039">here</a>: <code>ng-repeat="item in items | filter:keyword as filteredItems"</code></p>
  
  <h3>What I get:</h3>
  
  <p>Unfortunately, in Aurelia:</p>
  
  <p><code>d of filteredDocuments = documents|docfilter:query:categories</code></p>
  
  <p>actually means <code>d of</code> <strong>filteredDocuments = documents</strong> <code>|docfilter:query:categories</code>, and if I add brackets or <code>as</code>, it won't run (fails with a parser error).</p>
  
  <h3>So,</h3>
  
  <p>Is there a clean way of getting data out of data-filter <strong>in view</strong>?</p>
  
  <p>Best regards, Alexander</p>
  
  <hr>
  
  <h3>UPD 1: when I spoke about returning some data from the value controller I meant this:</h3>
  
  <pre><code>export class DocfilterValueConverter {
    toView(docs, query, categories, objectToPassCount) {
      ...
      objectToPassCount.count = result.length;
      ...
    });
  });
  </code></pre>
  
  <h3>UPD 2. Actually, I was wrong about this: <code>d of</code> <strong>filteredDocuments = documents</strong> <code>|docfilter:query:categories</code>. It does not solve the issue but what this code does is :</h3>
  
  <p>1) <code>filteredDocuments = documents |docfilter:query:categories</code> on init
  2) <code>d of filteredDocuments</code> which is a repeat over the filtered at the very beginning array</p>