sturoid
sturoid

Reputation: 2721

Set attributes on option in ember select

If I have a custom ember select (or any ember select) like:

App.SelectGender = Ember.Select.extend
  content: ['Gender', 'Male', 'Female']

And I want to set attributes on the first option like:

<option value="false" disabled="disabled" selected="selected">Gender</option>

How can I go about doing that? Thank you in advance for the help.

Upvotes: 0

Views: 86

Answers (1)

thecodejack
thecodejack

Reputation: 13379

Since understandably you wanted to add a prompt label for your Select component you can pass it as a property to Ember.Select like below.

{{view Ember.Select
       content=sexArray
       value=SelectedSex
       prompt="Gender"
}}

Docs link for same http://emberjs.com/api/classes/Ember.Select.html#toc_supplying-a-prompt

Upvotes: 1

Related Questions