title: TypeScript and Knockout binding to 'this' issue - lambda function needed?
body: <p>I've been creating a htmlHelper function using TypeScript and KnockoutJS to edit a list of emails.</p>
  
  <p>The list of emails is a Knockout ObservableArray called <strong>emails</strong>, and I have a link against each item to delete them. This is the HTML fragment:</p>
  
  <pre><code>&lt;ul data-bind="foreach: emails" &gt;
      &lt;li&gt;
          &lt;a href="#" data-bind="click: $parent.deleteItem"&gt;Delete&lt;/a&gt;
          &amp;nbsp;&lt;span data-bind="text: $data"&gt;&lt;/span&gt;
      &lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p>The delete link is bound to <strong>$parent.deleteItem</strong> this is a method in the viewmodel:</p>
  
  <pre><code>// remove item
  public deleteItem(emailToDelete: string) {
      // remove item from list
      this.emails.remove(emailToDelete);
  }
  </code></pre>
  
  <p>This all works until the deleteItem method is executed. The "this" in this method when it is called is the item in the array, and not the view model. Hence this.emails is a null reference and fails.</p>
  
  <p>I know that TypeScript supports the Lambda syntax but I can't find the right way to write this (there few examples out there).</p>
  
  <p>Or is there a different approach I could take?</p>