-
-
Save luxzeitlos/1c38cad596dfd2f0f16a274fd2f93977 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.Component.extend({ | |
critService: Ember.inject.service(), | |
actions: { | |
reloadCrits() { | |
this.get("critService").loadCrits(); | |
}, | |
modifyCritVal(crit, k) { | |
crit.set(k, "ABC 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
import Ember from 'ember'; | |
export default Ember.Component.extend({ | |
critService: Ember.inject.service(), | |
actions: { | |
modifyCritVal(crit, k) { | |
crit.set(k, "DEF 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
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'; | |
const Crit = Ember.Object.extend({ | |
data1: null, | |
data2: null | |
}); | |
const Crits = Ember.Object.extend({ | |
crit1: null, | |
crit2: null | |
}); | |
export default Ember.Service.extend({ | |
crits: null, | |
loadCrits() { | |
var c1 = Crit.create({ | |
data1: "one " + Math.random(), | |
data2: "two " + Math.random() | |
}); | |
var c2 = Crit.create({ | |
data1: "three " + Math.random(), | |
data2: "four " + Math.random() | |
}); | |
var crits = Crits.create({crit1: c1, crit2: c2}); | |
this.set("crits", crits); | |
}, | |
init() { | |
this._super(...arguments); | |
this.loadCrits(); | |
} | |
}); |
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.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.6.0", | |
"ember-data": "2.6.1", | |
"ember-template-compiler": "2.6.0" | |
}, | |
"addons": {} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment