Skip to content

Instantly share code, notes, and snippets.

@workmanw
Created June 30, 2012 01:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save workmanw/3021725 to your computer and use it in GitHub Desktop.
Save workmanw/3021725 to your computer and use it in GitHub Desktop.
View context preservation
App.UserWidget = Ember.View.extend({
templateName: 'widget.user.handlebars',
user:null
});
{{#each App.users}}
{{view App.UserWidget userBinding="this"}}
{{/each}}
{{#with view.user}}
<h1>{{lastname}}, {{firstname}}</h1>
<!-- target="this" is invalid, part of my confusion is how to use this with context. -->
<span {{action "deleteUser" target="this"}}>Delete User</span>
{{/with}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment