Skip to content

Instantly share code, notes, and snippets.

Avatar

Ryan Scott Subtletree

  • Wellington, New Zealand
View GitHub Profile
@Subtletree
Subtletree / adapters.application.js
Last active Aug 30, 2018 — forked from YoranBrondsema/adapters.application.js
Non-async relationship bug (3.2.1)
View adapters.application.js
import Adapter from "ember-data/adapters/json-api";
export default Adapter.extend();
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
applicationController: Ember.inject.controller('application'),
config: Ember.computed.reads('applicationController.config'),
stats: Ember.computed.reads('applicationController.model.stats'),
chartOptions: Ember.computed("model.hashrate", {
get() {
console.log(this.get('model'));
var e = this,
View models.car.js
import DS from 'ember-data';
import Ember from 'ember';
import { belongsTo, hasMany } from "ember-data/relationships";
export default DS.Model.extend({
make: DS.attr('string'),
owner: belongsTo('owner', { polymorphic: true })
});
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 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);
},
@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}`;
});
}),
You can’t perform that action at this time.