Instantly share code, notes, and snippets.

View mirage.config.js
export default function() {
//window.server = this;
this.get('users');
};
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
books: Ember.computed(function() {
//debugger;
return this.get('model').hasMany('books').value();
}),
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
View mirage.config.js
export default function() {
//window.server = this;
this.get('/foo', { data: "first response" });
this.namespace = '/namespace1';
this.get('/bar', { data: "second response" });
};
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
});
View mirage.config.js
export default function() {
//window.server = this;
this.get('/foo', (schema, request) => {
return schema.users.find(1);
});
};
View mirage.config.js
export default function() {
//window.server = this;
this.get('/foo', { data: "first response" });
this.namespace = '/namespace1';
this.get('/bar', { data: "second response" });
};
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
});
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
});
View controllers.application.js
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);
}),