title: Split and map array from comma separated string list in angularjs
body: <p>I want to merge two lists that are comma separated, <code>CENTURY, BADGER</code> &amp; <code>65, 85</code> to form an array like: <code>[{name: 'CENTURY', price: '65'}, {name: 'BADGER', price: 85}]</code>, the lists are in an json object:</p>
  
  <pre><code>{
      unit: '35 lb',
      brands: 'CENTURY, BADGER'
      prices: '65, 85'
  }
  </code></pre>
  
  <p>So what I've done is a filter:</p>
  
  <pre><code>angular
      .module( 'app.purchases.products' )
      .filter( 'mergeDetails', mergeDetails );
  
  function mergeDetails() {
      return function ( product ) {
          _.merge( product.brands, product.prices );//Using lodash, any suggestion?
          console.log('brands ', product.brands);
          return product.brands;//`_.merge` will add prices to brands
      }
  }
  </code></pre>
  
  <p>I'd like to know how to apply the filter to an interpolation <code>{{ }}</code> so that I could get the array and use it in a <code>ng-repeat</code>, here's where it is used:</p>
  
  <pre><code>&lt;tr ng-repeat="product in products"&gt;
      &lt;td&gt;{{product.unit}}&lt;/td&gt;
      &lt;td&gt;
          &lt;!-- Here I should filter to ng-repeat the resulting array --&gt;
          {{product.brands +' '+ product.prices}}
      &lt;/td&gt;
  &lt;/tr&gt;
  </code></pre>