Created
July 28, 2015 18:50
-
-
Save bj-mcduck/097f852f3d819be53afa to your computer and use it in GitHub Desktop.
Simple Select
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Component.extend({ | |
tagName: 'option', | |
attributeBindings: ['value', 'selected'], | |
label: null, | |
selected: Ember.computed('value', 'selection', function(){ | |
console.log(this.get('value')); | |
console.log(this.get('selection')); | |
return this.get('value') === this.get('selection'); | |
}) | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName:'Ember Twiddle', | |
options: [ | |
{label: 'All My Claims', value: ''}, | |
{label: 'My Active Claims', value: 'true'}, | |
{label: 'My Inactive Claims', value: 'false'} | |
], | |
selection: 'true', | |
actions: { | |
changeSelect(value){ | |
console.log('woot', value); | |
} | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": "0.4.0", | |
"dependencies": { | |
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js", | |
"ember": "https://cdnjs.cloudflare.com/ajax/libs/ember.js/1.13.5/ember.js", | |
"ember-data": "https://cdnjs.cloudflare.com/ajax/libs/ember-data.js/1.13.5/ember-data.js" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment