Skip to content

Instantly share code, notes, and snippets.

View elwayman02's full-sized avatar

Jordan Hawker elwayman02

View GitHub Profile
import Controller from '@ember/controller';
export default class ApplicationController extends Controller {
appName = 'Ember Twiddle';
}
@elwayman02
elwayman02 / controllers.application\.js
Last active October 8, 2020 21:27
Query Params Not Updating With Refresh
import Controller from '@ember/controller';
export default class ApplicationController extends Controller {
appName = 'Ember Twiddle';
}
@elwayman02
elwayman02 / components.my-component\.js
Last active September 16, 2020 17:29
Assert In Render
import Component from '@ember/component';
import { assert } from '@ember/debug';
import { later } from '@ember/runloop';
export default Component.extend({
foo: null,
init() {
this._super(...arguments);
@elwayman02
elwayman02 / components.masonry-demo\.js
Last active August 4, 2020 04:22
Ember CSS Grid Masonry
import Component from '@glimmer/component';
export default class extends Component {
constructor() {
super(...arguments);
this.items = new Array(16);
}
}
@elwayman02
elwayman02 / components.checkbox\.js
Last active August 3, 2020 19:10
Yielded Nested Checkboxes
import Component from '@glimmer/component';
export default class extends Component {
isIndeterminate = true;
toggleChildCheckbox(foo) {
this.toggleCheckbox(foo)
}
}
@elwayman02
elwayman02 / components.my-component\.js
Created July 15, 2020 23:36
Hash Object hasOwnProperty
import Component from '@glimmer/component';
export default class extends Component {
get fooString() {
return JSON.stringify(this.args.foo);
}
get hasBar() {
return this.args.foo.hasOwnProperty('bar');
}
import Component from '@glimmer/component';
export default class extends Component {
}
@elwayman02
elwayman02 / components.my-component\.js
Created June 24, 2020 00:08
Splattributes in ABC vs Classic
import Component from '@glimmer/component';
export default class extends Component {
}
import Component from '@glimmer/component';
import { action, set } from '@ember/object';
export default class extends Component {
showSecondYield = false;
@action
toggleSecondYield() {
set(this, 'showSecondYield', !this.showSecondYield);
}
import Component from '@glimmer/component';
export default class extends Component {
}