Skip to content

Instantly share code, notes, and snippets.

@DingoEatingFuzz
Created July 27, 2016 23:03
Show Gist options
  • Save DingoEatingFuzz/37a741cabc6efca41dfc29e322c6d70e to your computer and use it in GitHub Desktop.
Save DingoEatingFuzz/37a741cabc6efca41dfc29e322c6d70e to your computer and use it in GitHub Desktop.
Hrmm
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
noChange: function() {
return 'foo';
}.property(),
butWhy: function() {
console.log('changed!')
return this.get('noChange') + ' wat';
}.property('noChange'),
actions: {
changeTheThing: function() {
this.set('noChange', this.get('noChange'));
},
changeTheThingRandom: function() {
this.set('noChange', Math.random().toString())
}
}
});
<p>{{noChange}}
{{butWhy}}</p>
<button {{action "changeTheThing"}}>Same</button>
<button {{action "changeTheThingRandom"}}>Change</button>
{
"version": "0.10.2",
"EmberENV": {
"FEATURES": {}
},
"options": {
"use_pods": false,
"enable-testing": false
},
"dependencies": {
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js",
"ember": "1.12.2",
"ember-data": "1.13.15",
"ember-template-compiler": "1.12.2"
},
"addons": {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment