Javascript 余烬选择-将插座设置为“选择”

Javascript 余烬选择-将插座设置为“选择”,javascript,ember.js,Javascript,Ember.js,我希望创建一个下拉列表,并用模型中的值填充它 App.CoursesRoute = Ember.Route.extend({ model: function() { return Ember.RSVP.hash({ mathcourses: this.store.find('mathcourse'), quickmathunits: this.store.find('quickmathunit'), cscourses

我希望创建一个下拉列表,并用模型中的值填充它

App.CoursesRoute = Ember.Route.extend({

  model: function() {
      return Ember.RSVP.hash({
          mathcourses: this.store.find('mathcourse'),
          quickmathunits: this.store.find('quickmathunit'),
          cscourses: this.store.find('cscourse'),
          quickcsunits: this.store.find('quickcsunit'),
      })
  }

});


App.Mathcourse = DS.Model.extend({

    title: DS.attr('string'),

});

App.Mathcourse.FIXTURES = [
{id: 1,  title:'Algebra', math: true},
{id: 2,  title:'Geometry', math: false},
{id: 3,  title:'Algebra 2'},
{id: 4,  title:'Statistics'},
{id: 5, title:'Pre-Calculus'},
]
来自index.html

{{view Ember.Select
content= mathcourses
optionValuePath="content.id"
optionLabelPath="content.title"}}
来自app.js


有人知道要添加什么代码才能使此下拉选择按要求运行吗?该列表可以按需要工作,但我不确定如何使其在选择时使用ID作为链接。我希望它在不同子页面之间进行选择,作为备用菜单。

将选择设置为控制器内的变量:

{{view Ember.Select
content= mathcourses
optionValuePath="content.id"
optionLabelPath="content.title"
value=selected}}
selected: '',

MyComputedProperty: function(){
  //REDIRECT
}.property('selected'),
然后只需创建一个观察该变量的计算属性,并根据需要重定向它

控制器:

{{view Ember.Select
content= mathcourses
optionValuePath="content.id"
optionLabelPath="content.title"
value=selected}}
selected: '',

MyComputedProperty: function(){
  //REDIRECT
}.property('selected'),
重定向: