Last active
May 4, 2018 18:42
-
-
Save mriska/ac7b8100f7201f1b1be1e678e64459be 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'; | |
| import { getBy } from 'ember-awesome-macros'; | |
| export default Ember.Controller.extend({ | |
| obj: Ember.Object.create({ | |
| foo: 42 | |
| }), | |
| prop: 'foo', | |
| value: getBy('obj', 'prop'), | |
| actions: { | |
| changed: function(value) { | |
| const before = this.get('value'); | |
| this.set('obj.foo', value); | |
| const after = this.get('value'); | |
| console.log(`before: ${before}, after: ${after}`) | |
| } | |
| } | |
| }); |
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.13.0", | |
| "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.16.2", | |
| "ember-template-compiler": "2.16.2", | |
| "ember-testing": "2.16.2" | |
| }, | |
| "addons": { | |
| "ember-data": "2.16.3", | |
| "ember-awesome-macros": "0.41.0", | |
| "ember-macro-helpers": "0.17.1" | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment