Created
December 6, 2016 18:25
-
-
Save buschtoens/105f357c3ef5b59ae70eaa061cf280db to your computer and use it in GitHub Desktop.
New Twiddle
This file contains hidden or 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'; | |
const { | |
computed, | |
get, | |
set | |
} = Ember; | |
function makeCP(dependentKey) { | |
return computed(dependentKey, function() { | |
const value = get(this, dependentKey); | |
return `${dependentKey} -> ${value}`; | |
}); | |
} | |
export default Ember.Controller.extend({ | |
value: 'foo', | |
a: makeCP('value'), | |
b: makeCP('a'), | |
c: makeCP('b'), | |
d: makeCP('c'), | |
e: makeCP('d'), | |
f: makeCP('e'), | |
g: makeCP('f'), | |
h: makeCP('g'), | |
i: makeCP('h'), | |
j: makeCP('i'), | |
k: makeCP('j'), | |
l: makeCP('k'), | |
m: makeCP('l'), | |
n: makeCP('m'), | |
o: makeCP('n'), | |
p: makeCP('o'), | |
q: makeCP('p'), | |
actions: { | |
setValue(value) { | |
set(this, 'value', value); | |
} | |
} | |
}); |
This file contains hidden or 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.6", | |
"EmberENV": { | |
"FEATURES": {} | |
}, | |
"options": { | |
"use_pods": false, | |
"enable-testing": false | |
}, | |
"dependencies": { | |
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js", | |
"ember": "2.9.0", | |
"ember-data": "2.9.0", | |
"ember-template-compiler": "2.9.0", | |
"ember-testing": "2.9.0" | |
}, | |
"addons": {} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment