我是新的漂亮的烬宝js开发。如何将价值的余烬视图传递给控制器
我已经做视图下方代码
{{view "select" content=model prompt="Please select a name" selectionBinding="" optionValuePath="content.body" optionLabelPath="content.title"}}
使用以下的Json
posts = [{
title: "Raja",
body: "There are lots of à la carte software environments in this world."
}, {
title: "Broken Promises",
body: "James Coglan wrote a lengthy article about Promises in node.js."
}];
和路由器
App.InRoute = Ember.Route.extend({
model: function() {
return posts;
}
});
我的要求是使该组合框选择的值提供给控制器
App.InController = Ember.Controller.extend({
alert("combobox selected item")
});
怎么的我访问值apicontoller在.NET MVC 4
public class ValuesController : ApiController
{
string value= combo box selected value
}
我试图显示警报动作:{ 提交:函数(){ 警报(this.get( '将selectedItem')); }显示空值 – raj 2014-11-24 07:01:09
正如Asgaroth指出的那样,您还可以绑定到您的模型上的某个属性或控制器,或者可以工作。如果您使用值,请不要使用selectionBinding。 http://emberjs.com/api/classes/Ember.Select.html – 2014-11-25 14:49:47