Skip to content

Instantly share code, notes, and snippets.

import Component from '@glimmer/component';
import { inject as service } from '@ember/service';
export default class extends Component {
@service myService;
get bar() {
console.log(this.myService);
console.log(this.args.otherThing);
console.log(this.args.itemComponent);
@rlivsey
rlivsey / components.my-component\.js
Last active September 2, 2020 17:01
Pinned scroll
import Component from '@glimmer/component';
import { tracked } from "@glimmer/tracking";
import { action } from "@ember/object";
export default class extends Component {
@tracked items
constructor() {
super(...arguments);
@rlivsey
rlivsey / ember-fest-2018.md
Last active October 19, 2018 15:11
Ember Fest 2018
@rlivsey
rlivsey / controllers.application.js
Created September 18, 2018 13:21
Sticky Query Params Issue
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
@rlivsey
rlivsey / controllers.application.js
Last active September 18, 2018 12:20
New Twiddle
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
import Ember from 'ember';
export default Ember.Component.extend({
name: null,
counter: 1,
didRender() {
this._super(...arguments);
console.log(`didRender called on ${this.get('name')}`);
},
// services/router.js
import Router from '@ember/services/router' // or wherever it lives
import Evented from '@ember/evented'
export default Router.extend(Evented);
// your helper
export default Helper.extend({
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
user: Ember.Object.create({
name: "Bob Bobbington",
things: [
Ember.Object.create({ name: "A thing" })
]
})