Skip to content

Instantly share code, notes, and snippets.

@philcockfield
Created October 21, 2012 18:28
Show Gist options
  • Save philcockfield/3927997 to your computer and use it in GitHub Desktop.
Save philcockfield/3927997 to your computer and use it in GitHub Desktop.
{ #each _songs }
<li>
<input type="text" value="{.name}"/>
{#if _canAdmin}
<button class="btn btn-mini" x-bind="click:deleteSong">Delete</button>
{/}
</li>
{/}
@deleteSong = (e, el, next) ->
song = model.at(el).get()
@deleteSong = (e, el, next) ->
elParent = $(el).parent() # NB: Using jQuery here to grab the parent element.
song = model.at(elParent).get()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment