Created
March 28, 2017 18:59
-
-
Save RuslanZavacky/b273b02804f228381c5bf5ed7b9fa69e to your computer and use it in GitHub Desktop.
keyed-computeds
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 EmberObject from 'ember-object'; | |
| export default Ember.Controller.extend({ | |
| appName: 'Ember Twiddle', | |
| keyed: EmberObject.create({ | |
| one: EmberObject.create({ val1: 1, val2: 2 }), | |
| two: EmberObject.create({ val1: 2, val2: 3 }), | |
| three: EmberObject.create({ val1: 3, val2: 4 }), | |
| }), | |
| init() { | |
| this._super(...arguments); | |
| setTimeout(() => { | |
| console.log('timeout fired'); | |
| this.get('keyed').set('four', EmberObject.create({ val1: 4, val2: 5 })) | |
| }, 2000); | |
| setTimeout(() => { | |
| console.log('timeout fired'); | |
| this.get('keyed').get('two').set('val2', 10); | |
| }, 3000); | |
| } | |
| }); |
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.12.1", | |
| "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.12.0", | |
| "ember-template-compiler": "2.12.0", | |
| "ember-testing": "2.12.0" | |
| }, | |
| "addons": { | |
| "ember-data": "2.12.1" | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment