Skip to content

Instantly share code, notes, and snippets.

@AmilKey
Forked from rtablada/application.controller.js
Last active June 29, 2016 18:03
Show Gist options
  • Save AmilKey/73cfdbe3068d0399ccac to your computer and use it in GitHub Desktop.
Save AmilKey/73cfdbe3068d0399ccac to your computer and use it in GitHub Desktop.
Show Select 2.0
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle',
vehicle: '',
vehicles: [1,2,3],
});
<select onchange={{action (mut vehicle) value="target.value"}}>
{{#each vehicles as |vehicleChoice|}}
<option value={{ vehicleChoice }} selected={{eq vehicleChoice vehicle}}>{{vehicleChoice}}</option>
{{/each}}
</select>
<p>
Vehicle: {{vehicle}}
</p>
import Ember from 'ember';
export function eq(params/*, hash*/) {
return params[0] === params[1];
}
export default Ember.Helper.helper(eq);
{
"version": "0.4.9",
"dependencies": {
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js",
"ember": "1.13.13",
"ember-data": "1.13.15",
"ember-template-compiler": "1.13.13"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment