Skip to content

Instantly share code, notes, and snippets.

import Controller from '@ember/controller';
import { tracked } from '@glimmer/tracking';
import { action } from '@ember/object';
const { stringify } = JSON;
export default class ApplicationController extends Controller {
maxId = 6;
@tracked
listOne = [
import Component from 'ember-component';
import computed from 'ember-computed';
export default Component.extend({
didReceiveAttrs() {
this._super(...arguments);
// Comment this line to fix
this.get('sum');
import Ember from 'ember';
export default Ember.Component.extend({
actions: {
save() {
this.get('onSave')(this.get('niceThing'));
},
close() {
this.get('onClose')(this.get('niceThing'));
import Ember from 'ember';
export default Ember.Component.extend({
});
import Ember from 'ember';
export default Ember.Controller.extend({
actions: {
async save() {
try {
await this.get('foo').save();
await this.set('saved', true);
} catch(ex) {
console.log("test");
import Ember from 'ember';
import { task, timeout } from 'ember-concurrency';
function asyncComputed(...deps) {
let taskFn = deps.pop();
let fn = task(taskFn).restartable().toFunction();
return Ember.computed(...deps, function() {
let args = deps.map(dep => this.get(dep));
return fn(...args);
});
import { subscribe } from 'ember-instrumentation';
import { bind } from 'ember-runloop';
import EmberObject from 'ember-object';
export default EmberObject.extend({
init() {
this._super(...arguments);
subscribe('render.component', {
before: bind(this, '_before'),
after: bind(this, '_after')