How to bind a select list with SproutCore 2.0 and Handlebars
- by Garth
Given the following SC.View object:
var view = SC.View.create({
templateName: 'people',
people: [],
selectedPersonId: null});
and the following people Handlebars template:
<select>
{{#each people}}
<option {{bindAttr id="id"}}>{{name}}</option>
{{/each}}
</select>
What would be the best way to bind the selectedPersonId to the select list?
(@stackoverflow: Reputation of 1500+ to create new tags? really?.... #sproutcore20 #handlebars)