Last active
August 27, 2018 13:45
-
-
Save tomoguisuru/3d506b8a31e0c27acebca0cd1dc27b3d to your computer and use it in GitHub Desktop.
Computed Prop (get/set)
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: 'get/set Demo', | |
model: null, | |
valueOne: 'Hello', | |
valueTwo: Ember.computed('valueOne', function() { | |
return this.get('valueOne') + ' from two'; | |
}), | |
valueThree: Ember.computed('valueOne', { | |
get() { | |
return this.get('valueOne'); | |
}, | |
set(p, v) { | |
return v; | |
} | |
}) | |
}); |
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.14.1", | |
"EmberENV": { | |
"FEATURES": {} | |
}, | |
"options": { | |
"use_pods": false, | |
"enable-testing": false | |
}, | |
"dependencies": { | |
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js", | |
"ember": "2.18.2", | |
"ember-template-compiler": "2.18.2", | |
"ember-testing": "2.18.2" | |
}, | |
"addons": { | |
"ember-data": "2.18.2" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment