title: Limit foreach loop knockout
body: <p>I have this knockout mapping my array retreived from the ajax call below.</p>
  
  <pre><code>function InvoiceViewModel(data) {
  var self = this;
  
  self.survey = data;
  
  }
  </code></pre>
  
  <p>Ajax Call</p>
  
  <pre><code>$.ajax({
      url: 'http://localhost:43043/api/damage',
      type: 'GET',
      headers: { 'Accept': 'application/json' },
      data: {
          orderNumber: num,
          category: cat
      },
      success:
             function (data) {
                 var usingRoutData = document.URL;
                 ko.applyBindings(new InvoiceViewModel(data));
             },
  
      error: function () {
          alert('failure');
      }
  
  });
  </code></pre>
  
  <p>My Array</p>
  
  <pre><code> var test = {
    Name: Blah,
    Attributes: [
                 {Name: Test, Type: Photo, Year:1988},
                 {Name: Test, Type: Photo, Year:1988},
                 {Name: Test, Type: Photo, Year:1988}
                ]
              };
  </code></pre>
  
  <p>How I am binding my data</p>
  
  <pre><code> &lt;div id="invoiceBodyWrapper"&gt;
  &lt;div data-bind="template: { name: 'invoice-template', foreach: surveys }"&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p></p>
  
  <pre><code>&lt;div class="invoiceWrapper"&gt;
      &lt;/div&gt;
      &lt;div id="completePictureWrapper" data-bind="template: { name: 'photo-template',     foreach: new Array(Attributes) }"&gt;&lt;/div&gt;
  
  &lt;/div&gt;
  &lt;/script&gt;
  
  &lt;script type="text/html" id="photo-template"&gt;
  &lt;!-- ko if: classification === 'photo' --&gt;
  &lt;div id="pictureWrappers"&gt;
      &lt;img class="img" data-bind="attr: { src: 'http://myimagepath/download/full/' +    $index()+1 }" /&gt;
  &lt;/div&gt;
  &lt;!-- /ko --&gt;
   &lt;/script&gt;
    &lt;script src="~/Scripts/DamageInvoiceCreation.js"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>I need a way to limit my attributes foreach loop to only show 2 of the 3 attributes. I have only found a few things on how to do this and they seem very overly complicated. I cannot imagine there is not a simple way to do this in knockout.</p>