Last active
March 9, 2017 02:09
-
-
Save GavinJoyce/0b95e3a8dcacabfbe3fe67c0ed240ec9 to your computer and use it in GitHub Desktop.
New Twiddle
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({ | |
attributeBindings: ['style'], | |
count: 0, | |
expanded: false, | |
style: Em.computed('expanded', function() { | |
this.incrementProperty('count'); | |
if(this.get('expanded')) { | |
return `background-color: lightgreen`.htmlSafe(); | |
} else { | |
return `background-color: yellow`.htmlSafe(); | |
} | |
}), | |
actions: { | |
toggle() { | |
this.toggleProperty('expanded'); | |
} | |
} | |
}); |
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({ | |
}); |
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.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": "alpha", | |
"ember-data": "2.7.0", | |
"ember-template-compiler": "alpha" | |
}, | |
"addons": {} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment