いくつかの機能を追加するだけの専用の選択コントロールビューを作成したいと思います。簡単にするために、タイトルを追加できるようにしたいと思います。
コントロール/ビュー:
window.App.ControlsSelectView = Ember.View.extend({
templateName: 'controls/SelectView',
title:"Hello Control",
contentBinding: null
});
一致するhtml:
<div class="sub_heading">
<h2>{{title}}</h2>
</div>
<div class="inner_12 input_wrapper custom_select">
{{view Ember.Select
multiple="true"
contentBinding= "contentBinding" // how to pass parameters through?
selectionBinding="content.tempSelectedFunctions"
optionLabelPath="content.displayname"
optionValuePath="content.id"
}}
</div>
使用法は次のようになります。
{{ view App.ControlsSelectView
contentBinding="content.data.responsibilities"
selectionBinding="content.tempSelectedFunctions"
title="content.responsibilitTitle"
}}
問題は、それがそのように機能しないということです。上記は可能ですか?または、単純で再利用可能なコントロールを作成するためのより良いパターンはありますか?