In my ember view, I want to get the person during this each and pass it into action, but currently I only get the jquery event in the router (curious if this is context bound for free in pre 1.0 now)
template
<script type="text/x-handlebars" data-template-name="person"> {{#each person in controller}} <li> {{person.username}} <input type="submit" value="delete" {{action removePerson person}}/> </li> {{/each}} </script>
router w / method that I was hoping to call in the user context
Router: Ember.Router.create({ root: Ember.Route.extend({ index: Em.Route.extend({ route: '/', removePerson: function(router, context) { router.get('personController').removePerson(context); },
in details
PersonController: Ember.ArrayController.extend({ content: [], addPerson: function (username) { var person = PersonApp.Person.create({ username: username }); this.pushObject(person); }, removePerson: function (person) { this.removeObject(person); } }),
source share