Created
April 16, 2012 16:42
-
-
Save sgharms/2399873 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{{ view Ember.Select | |
contentBinding="Sorter.SortController.options" | |
optionLabelPath="content.label" | |
optionValuePath="content.value" | |
prompt="Sort some numbers..." | |
selectionBinding="Sorter.SortController.selected" | |
}} | |
But I want to say... | |
{{view Myapp.MySelect }} // such that it has all the bindings as above. |
I would recommend this:
MyApp.MySelect = Ember.Select.extend({
target: null,
contentBinding="target.options",
selectionBinding="target.selected",
optionLabelPath="content.label",
optionValuePath="content.value",
prompt: "Sort some numbers..."
});
then
{{view MyApp.MySelect targetBinding="Sorter.SortController"}}
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Like:
Sorter.mySelectView = Ember.Select.extend({
options: [
{label : 'uno', value: 'one' },
{label : 'dos', value: 'two' },
]
})