Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ember.js/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript Emberjs-Ember.Select valueBinding无法工作_Javascript_Ember.js - Fatal编程技术网

Javascript Emberjs-Ember.Select valueBinding无法工作

Javascript Emberjs-Ember.Select valueBinding无法工作,javascript,ember.js,Javascript,Ember.js,我有一个简单的余烬。选择并使用valueBinding选项 更改选择值应更改上面显示的值。事实并非如此 我猜你的意思是selectionBinding并且它绑定了对象,所以使用{{App.power.label} <script type="text/x-handlebars"> App Power : {{#if App.power}}{{App.power.label}}{{else}}Not yet set{{/if}} <hr/>

我有一个简单的余烬。选择并使用valueBinding选项

更改选择值应更改上面显示的值。事实并非如此


我猜你的意思是
selectionBinding
并且它绑定了对象,所以使用
{{App.power.label}

<script type="text/x-handlebars">
    App Power : {{#if App.power}}{{App.power.label}}{{else}}Not yet set{{/if}}
    <hr/>
        {{view Ember.Select
        contentBinding="App.booleanOptions"
        selectionBinding="App.power"
        optionLabelPath="content.label"
        optionValuePath="content.value"
        id="emberEnhanced"
      }}
</script>

应用程序电源:{{{if App.Power}{{App.Power.label}{{else}}尚未设置{{/if}

{{查看余烬。选择 contentBinding=“App.booleanpoptions” selectionBinding=“App.power” optionLabelPath=“content.label” optionValuePath=“content.value” id=“增强” }}
我猜你的意思是
selectionBinding
它绑定了对象,所以使用
{{App.power.label}

<script type="text/x-handlebars">
    App Power : {{#if App.power}}{{App.power.label}}{{else}}Not yet set{{/if}}
    <hr/>
        {{view Ember.Select
        contentBinding="App.booleanOptions"
        selectionBinding="App.power"
        optionLabelPath="content.label"
        optionValuePath="content.value"
        id="emberEnhanced"
      }}
</script>

应用程序电源:{{{if App.Power}{{App.Power.label}{{else}}尚未设置{{/if}

{{查看余烬。选择 contentBinding=“App.booleanpoptions” selectionBinding=“App.power” optionLabelPath=“content.label” optionValuePath=“content.value” id=“增强” }}
看起来我在询问一个尚未发布的功能。当前版本是0.9.8.1,valueBinding位于主干中

看起来我在询问一个尚未发布的功能。当前版本是0.9.8.1,valueBinding在trunk中

,顺便问一下,您是否检查了我的答案?顺便问一下,你检查过我的答案了吗?如图所示,通过将App.power初始化为null,可以避免模板中的if语句。这是一个有用的信息,我没有注意到:)+1,仅供参考,您可以通过将App.power初始化为null来避免模板中的if语句。这是一个有用的信息,我没有注意到:)