1

I can't figure out how to use the valueBinding property of Ember.Select to bind the selected value directly to a object from Ember.Data's store.

Fiddle: http://emberjs.jsbin.com/jipamiro/14/edit

The problem I'm facing is that the model returns DS.RecordArray object and I just need the selection value. I tried "firstObject", computed properties and so on to no avail and running out of ideas....

thepeter
  • 73
  • 4

1 Answers1

1

Here is a working bin.

I modified the model hook in the route and the valueBinding property in the template. In the model hook, I am specifying which item to find instead of returning the whole array.

App.IndexRoute = Ember.Route.extend({
  model: function() {
    return this.store.find('setup', 0); 
  } 
});

{{view Ember.Select class="form-control" 
  viewName="channel"
  content=channelOptions
  optionValuePath="content.id"
  optionLabelPath="content.name"
  valueBinding="selectedChannel"}}
blessanm86
  • 31,439
  • 14
  • 68
  • 79