title: Emberjs - get the value of a component
body: <p>I'm using a component to build select elements with Ember. Every time one of the select value is changed, I need to get the value of each of them. The problem is I can only get the value of the changed one. How can I select a component from the route?</p>
  
  <p>Part of the app:</p>
  
  <pre><code>// the route
  App.TeamsRoute = Ember.Route.extend({
      setupController: function() {
        // send the values to build the options
        App.Category.findAll().then(function(categories) {
          controller.set('categories', categories)
        })
      },
  
      actions: {
        updateTeams: function() {
          // action triggered when a select is changed
          var controller = this.get('controller')
  
          // ?????
        }
      }
  })
  
  // component to trigger the action
  App.CustomSelectComponent = Ember.Component.extend({
    change: function() {
      this.sendAction('action')
    }
  })
  </code></pre>
  
  <p>The templates:</p>
  
  <pre><code>// the way I build the element
  {{custom-select choices=categories name="category" action="updateTeams"}}
  
  // component template
  &lt;script type="text/x-handlebars" id="components/custom-select"&gt;
      &lt;select name="{{name}}"&gt;
          {{#each choices}}
              &lt;option value="{{unbound value}}"&gt;{{name}}&lt;/option&gt;
          {{/each}}
      &lt;/select&gt;
  &lt;/script&gt;
  </code></pre>