Last active
March 13, 2019 00:08
-
-
Save chancancode/927d81c4e4b470ad5e35c7ec5e6e7862 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'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember 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'; | |
export default Ember.Helper.extend({ | |
init() { | |
this._super(...arguments); | |
this.set('i', 0); | |
this.tick(); | |
}, | |
tick() { | |
this.incrementProperty('i'); | |
this.recompute(); | |
Ember.run.later(() => this.tick(), 1000); | |
}, | |
compute() { | |
let { i } = this; | |
let fragment = document.createDocumentFragment(); | |
let div1 = document.createElement('div'); | |
let text1 = document.createTextNode(`div1.${i}!`); | |
div1.appendChild(text1); | |
fragment.appendChild(div1); | |
let div2 = document.createElement('div'); | |
let text2 = document.createTextNode(`div2.${i}!`); | |
div2.appendChild(text2); | |
fragment.appendChild(div2); | |
return fragment; | |
} | |
}); |
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.15.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": "3.4.3", | |
"ember-template-compiler": "3.4.3", | |
"ember-testing": "3.4.3" | |
}, | |
"addons": { | |
"ember-data": "3.4.2" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment