Skip to content

Instantly share code, notes, and snippets.

View adapters.application.js
import { RESTAdapter } from 'ember-data/adapter';
console.log("here")
export default RESTAdapter.extend({});
View controllers.application.js
import Ember from 'ember';
import { inject as service } from '@ember/service';
export default Ember.Controller.extend({
store: service(),
appName: 'Ember Twiddle',
async init() {
// Open the console
this.loadDog(1);
View adapters.draft.js
import DS from 'ember-data';
export default DS.JSONAPIAdapter.extend({
updateRecord(store, type, { record }) {
console.log("Saving draft", record.id);
return sleep(1000);
},
createRecord(store, type, { record }) {
console.log("Creating draft", record.body);
View controllers.application.js
import Ember from 'ember';
import { inject as service } from '@ember/service';
export default Ember.Controller.extend({
store: service(),
appName: 'Ember Twiddle',
logs: Ember.A([]),
init() {
// Add an example record
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
a: Ember.computed(function() {
return 1;
}),
init() {
View controllers.application.js
import Ember from 'ember';
import { inject as service } from '@ember/service';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
store: service(),
init() {
this.store.push({
data: [{
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 { later, debounce } from '@ember/runloop';
export default Ember.Controller.extend({
sync(schedulerType) {
console.log("syncing via", schedulerType);
},
actions: {
case1() {
View -
Filename: "Capture d’écran 2017-06-01 à 14.27.15.png", key: "970a5cb2-9301-4531-af5e-f36dd75f9b33.Capture d’écran 2017-06-01 à 14.27.15.png"
Filename: "Capture d’écran 2017-06-01 à 14.27.15.png", key: "970a5cb2-9301-4531-af5e-f36dd75f9b33.Capture d’écran 2017-06-01 à 14.27.15.png"
Filename: "Capture d’écran 2017-06-01 à 14.27.15.png", key: "970a5cb2-9301-4531-af5e-f36dd75f9b33.Capture d’écran 2017-06-01 à 14.27.15.png"
Filename: "Screen Shot 2017-06-01 at 12.23.59.png", key: "8c4a630d-f49b-4a11-ae9c-b273183c8c81.Screen Shot 2017-06-01 at 12.23.50.png"
Filename: "Capture d’écran 2017-06-30 à 11.35.14.png", key: "f1c13402-e564-447c-b7ed-e21bf033f9d1.Capture d’écran 2017-06-30 à 11.35.14.png"
Filename: "Capture d’écran 2017-07-31 à 15.07.07.png", key: "dbae3ea6-6d2f-4265-bb1b-aade08c284ce.Capture d’écran 2017-07-31 à 15.07.07.png"
Filename: "Edit-New_Respimat-Übersicht-170802-DK.jpg", key: "17ebe573-a5b2-455a-b430-e217a9ee09ce.Edit-New_Respimat-Übersicht-170802-DK.jpg"
Filename: "Edit-New_R
View infinte-rejection-loop.js
process.on("unhandledRejection", function(reason, p) {
console.log(reason, p);
console.log("Rejection handled")
new Promise(function(resolve, reject) {
console.log("Second rejection")
reject(new Error("Foo"));
});
});
You can’t perform that action at this time.