Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7093303
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T08:25:20+00:00 2026-05-28T08:25:20+00:00

I try to bind value from input select to attribute selectedValue in controller. This

  • 0

I try to bind value from input select to attribute “selectedValue” in controller.

This is app.js

Food = Ember.Application.create();

Food.appsController = Ember.Object.create({
  selectedValue: ""
});

Food.Todo = Ember.Object.extend({
  title: null,
  value: null
});

Food.FoodController = Ember.ArrayProxy.create({
  content: []
});

Food.FoodController.pushObject(Food.Todo.create({title:"a", value:"1"}));
Food.FoodController.pushObject(Food.Todo.create({title:"b", value:"2"}));
Food.FoodController.pushObject(Food.Todo.create({title:"c", value:"3"}));

This is index.html

{{#collection
    contentBinding="Todos.todosController"
    tagName="select"
    itemClassBinding="content.isDone"}}
  {{content.title}}
{{/collection}}

Output look like this

<select id="ember180" class="ember-view">
  <option id="ember192" class="ember-view">
    <script id="metamorph-0-start" type="text/x-placeholder"></script>
    a
    <script id="metamorph-0-end" type="text/x-placeholder"></script>
  </option>
  <option id="ember196" class="ember-view">
    <script id="metamorph-1-start" type="text/x-placeholder"></script>
    b
    <script id="metamorph-1-end" type="text/x-placeholder"></script>
  </option>
  <option id="ember200" class="ember-view">
    <script id="metamorph-2-start" type="text/x-placeholder"></script>
    c
    <script id="metamorph-2-end" type="text/x-placeholder"></script>
  </option>
</select>

I have no idea how to add value to option and how to binding selected value back to controller.
Is this possible to do in Emberjs?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T08:25:21+00:00Added an answer on May 28, 2026 at 8:25 am

    Ember now has a built-in Select view.

    You can find it in the latest Ember.js build here: http://cloud.github.com/downloads/emberjs/ember.js/ember-latest.js

    Here’s an example usage:

    var App = Ember.Application.create();
    
    App.Person = Ember.Object.extend({
        id: null,
        firstName: null,
        lastName: null,
    
        fullName: function() {
            return this.get('firstName') + " " + this.get('lastName');
        }.property('firstName', 'lastName').cacheable()
    });
    
    App.selectedPersonController = Ember.Object.create({
        person: null
    });
    
    App.peopleController = Ember.ArrayController.create({
        content: [
            App.Person.create({id: 1, firstName: 'Yehuda', lastName: 'Katz'}),
            App.Person.create({id: 2, firstName: 'Tom', lastName: 'Dale'}),
            App.Person.create({id: 3, firstName: 'Peter', lastName: 'Wagenet'}),
            App.Person.create({id: 4, firstName: 'Erik', lastName: 'Bryn'})
        ]
    });
    

    Your template would look like:

    {{view Ember.Select
           contentBinding="App.peopleController"
           selectionBinding="App.selectedPersonController.person"
           optionLabelPath="content.fullName"
           optionValuePath="content.id"}}
    

    Again, here’s a jsFiddle example: http://jsfiddle.net/ebryn/zgLCr/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When I try to bind a valueconverter from a defined enum Status to brush,
Hi I try solve this situation. I have WPF app with MVVM design. I
I need to obtain the value from the Label Template Field which is bind
I try to bind a NSString value into my SQL query but its not
I try to bind an IPv6 server socket in Java 1.6 on Windows 7,
When I try to bind port 80 to a socket in c, i always
I am try to bind the dropdowmlist using jquery. But is showing some error.
I'm trying to bind a function with a non-existent class. I will try to
Try loading this normal .jpg file in Internet Explorer 6.0. I get an error
I am trying to use datasource and bind in my application to set a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.