Skip to content

Instantly share code, notes, and snippets.

@nragaz
Created September 1, 2016 19:05
Show Gist options
  • Save nragaz/0b01e3d68f0f0287d28eab766d16ea21 to your computer and use it in GitHub Desktop.
Save nragaz/0b01e3d68f0f0287d28eab766d16ea21 to your computer and use it in GitHub Desktop.
Binding attr=null outputs attr="true"
import Ember from 'ember';
export default Ember.Controller.extend({
value: null,
actual: null,
actions: {
getActual() {
this.set('actual', Ember.$('select option:first-child').val());
}
}
});
<select>
<option value="{{value}}">Null value?</option>
</select>
<button type="button" {{action "getActual"}}>Read Actual Value</button>
<p>Actual value: {{actual}}</p>
{
"version": "0.10.4",
"EmberENV": {
"FEATURES": {}
},
"options": {
"use_pods": false,
"enable-testing": false
},
"dependencies": {
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js",
"ember": "canary",
"ember-data": "2.7.0",
"ember-template-compiler": "canary"
},
"addons": {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment