Skip to content

Instantly share code, notes, and snippets.

import Controller from '@ember/controller';
import EmberObject from '@ember/object';
function logged(target, key, descriptor) {
let { initializer } = descriptor;
let get = function() {
console.log(`Get ${key}`); // DOES NOT LOG!
return initializer();
};
import Controller from '@ember/controller';
import { inject as service } from '@ember/service';
export default class ApplicationController extends Controller {
appName = 'Ember Twiddle';
transitionToQp = () => {
this.router.transitionTo({ queryParams: { foo: 123 } });
this.router.transitionTo('foo');
this.router.transitionTo({ queryParams: { foo: 1234 } });
@NullVoxPopuli
NullVoxPopuli / components.message\.hbs
Last active June 28, 2020 16:29
Vertical Collection - Mixed Sizes
<div class='message'>
{{@message}}
</div>
@NullVoxPopuli
NullVoxPopuli / components.demo\.hbs
Last active June 21, 2020 15:15
StackOverflow 60055682 but with tracked everything
<section>
<h2>items in the component</h2>
<ul>
{{#each this.items as |item|}}
<li>
{{item.quantity}} x {{item.name}}
<button class='button-sm' {{on 'click' (fn this.add item)}}>
Add Item
</button>
@NullVoxPopuli
NullVoxPopuli / components.demo\.hbs
Last active June 21, 2020 15:11
StackOverflow 60055682 but with tracked-built-ins
<section>
<h2>items in the component</h2>
<ul>
{{#each this.items as |item|}}
<li>
{{item.quantity}} x {{item.name}}
<button class='button-sm' {{on 'click' (fn this.add item)}}>
Add Item
</button>
@NullVoxPopuli
NullVoxPopuli / components.demo\.hbs
Last active June 21, 2020 15:07
StackOverflow 60055682
<section>
<h2>items in the component</h2>
<ul>
{{#each this.items as |item|}}
<li>
{{item.quantity}} x {{item.name}}
<button class='button-sm' {{on 'click' (fn this.add item)}}>
Add Item
</button>
@NullVoxPopuli
NullVoxPopuli / components.render-in-target\.hbs
Created June 17, 2020 19:00
Ember Inspector {{in-element}} test
{{#-in-element this.element}}
this text is in the target div
{{/-in-element}}
<ol>
<li>Open browser dev tools</li>
<li>click "Make True"</li>
<li>click "Make False"</li>
<li>Notice an error in the console</li>
</ol>
<button {{on 'click' this.makeTrue}}>
Make True
</button>
@NullVoxPopuli
NullVoxPopuli / components.chat-entry\.hbs
Last active June 7, 2020 00:43
height vs max-height vs line-height
<div class="chat-entry-container">
<div class="control">
<button
type='button'
class='dropdown-trigger'
>
<FaIcon @icon='plus' />
</button>
</div>

Keybase proof

I hereby claim:

  • I am nullvoxpopuli on github.
  • I am nullvoxpopuli (https://keybase.io/nullvoxpopuli) on keybase.
  • I have a public key ASBdAM3xFHnPFpBs2S3HffJ93uB48AXqC19NHjr41BZ4Bwo

To claim this, I am signing this object: