This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 = [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Component.extend({ | |
actions: { | |
save() { | |
this.get('onSave')(this.get('niceThing')); | |
}, | |
close() { | |
this.get('onClose')(this.get('niceThing')); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Component.extend({ | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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') |