Skip to content

Instantly share code, notes, and snippets.

View aaronfischer's full-sized avatar

Aaron Fischer aaronfischer

View GitHub Profile
@aaronfischer
aaronfischer / controllers.application.js
Created April 18, 2018 02:02 — forked from sukima/controllers.application.js
test iterate object and change value
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
thing: {
'first-name': 'Aaron',
'hello_last-name': '',
'status': '',
},
@aaronfischer
aaronfischer / controllers.application.js
Last active April 17, 2018 20:53
test iterate object and change value
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
thing: {
'first-name': '',
'last-name': '',
'status': '',
},
actions: {
@aaronfischer
aaronfischer / controllers.foo.js
Last active January 18, 2018 05:57 — forked from sukima/controllers.foo.js
Infinate route refresh two task approach - from @sukima
import Ember from 'ember';
export default Ember.Controller.extend({
people: Ember.computed.or('model.{current,previous}.value'),
isLoading: Ember.computed.reads('model.current.isRunning'),
fetchError: Ember.computed.reads('model.current.error'),
actions: {
fetchMore() {
this.send('refreshModel');
import Ember from 'ember';
export default Ember.Controller.extend({
db: Ember.computed('refreshDb', function() {
let dump = window.server.schema.db.dump();
return JSON.stringify(dump, null, 2);
}),
import Ember from 'ember';
export default Ember.Controller.extend({
});
@aaronfischer
aaronfischer / controllers.application.js
Last active January 25, 2017 18:09 — forked from samselikoff/controllers.application.js
Mirage 0.3 - One to Many
import Ember from 'ember';
export default Ember.Controller.extend({
db: Ember.computed('refreshDb', function() {
let dump = window.server.schema.db.dump();
return JSON.stringify(dump, null, 2);
}),
@aaronfischer
aaronfischer / adapters.application.js
Last active January 19, 2018 17:39 — forked from samselikoff/mirage.config.js
mirage reflexive - include error
import DS from 'ember-data';
import UrlTemplates from 'ember-data-url-templates';
export default DS.JSONAPIAdapter.extend(UrlTemplates, {
host: '',
namespace: 'api',
urlTemplate: '{+host}/{+namespace}/{pathForType}{/id}',
});
import Ember from 'ember';
export default Ember.Component.extend({
tagName: 'ul',
display: Ember.computed('data.[]', function() {
return this.get('data').slice(-1)[0];
}),
nested: Ember.computed('data.[]', function() {
return this.get('data').slice(0, -1);
}),
@aaronfischer
aaronfischer / components.app-activity-tree.js
Last active August 25, 2016 16:36
Recursive Reverse List
import Ember from 'ember';
export default Ember.Component.extend({
tagName: 'ul',
display: Ember.computed('data', function() {
return this.get('data').pop();
}),
nested: Ember.computed('data', function() {
return this.get('data').slice(0, -1);
}),
import Adapter from "ember-data/adapters/json-api";
export default Adapter.extend();