Skip to content

Instantly share code, notes, and snippets.

Avatar

Ryan Scott Subtletree

  • Wellington, New Zealand
View GitHub Profile
View components.component-one.js
import Ember from 'ember';
export default Ember.Component.extend({
});
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
});
View components.my-component.js
import Ember from 'ember';
export default Ember.Component.extend({
didInitAttrs(options) {
console.log('didInitAttrs', options);
},
didUpdateAttrs(options) {
console.log('didUpdateAttrs', options);
},
View components.child-component.js
import Ember from 'ember';
export default Ember.Component.extend({
number: 0,
actions: {
inc() {
this.incrementProperty('number');
}
},
View components.my-component.js
import Ember from 'ember';
export default Ember.Component.extend({
actions: {
example(sometext) {
alert(sometext);
}
}
});
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
View controllers.application.js
import Ember from 'ember';
import file from '../file';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
init() {
this._super(...arguments);
this.set('variable', file.variable);
},
View controllers.application.js
import Ember from 'ember';
const reData = {
catType: 'home',
listCategory: false,
search: true
}
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
@Subtletree
Subtletree / components.foo-component.js
Last active Sep 16, 2017 — forked from williamhaley/README.md
Ember Twiddle Demo: Mirage with Ember Twiddle
View components.foo-component.js
import Ember from 'ember';
export default Ember.Component.extend({
computedModel: Ember.computed('model.[]', function() {
return this.get('model').map(function(m) {
return `Computed: ${m.id}`;
});
}),
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
You can’t perform that action at this time.