Skip to content

Instantly share code, notes, and snippets.

View k-fish's full-sized avatar
🐟

Kev k-fish

🐟
  • Toronto, Canada
View GitHub Profile
import Component from '@ember/component';
export default Component.extend({
didInsertElement() {
this._super(...arguments);
}
});
@k-fish
k-fish / components.my-component\.js
Last active April 13, 2020 16:51
Routing example
import Component from '@ember/component';
export default Component.extend({
baseProperty: 'hello'
});
@k-fish
k-fish / controllers.application\.js
Created March 6, 2020 13:39
Model prop undefined
import Ember from 'ember';
export default Ember.Controller.extend({
example: Ember.computed(function() {
const rec = this.store.createRecord('my-model', {
});
console.log(rec);
})
});
@k-fish
k-fish / controllers.application.js
Last active February 28, 2020 21:16
Parent / Child routes
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
@k-fish
k-fish / components.example-component.js
Last active December 6, 2019 14:37
Debounce Example
import Ember from 'ember';
import { run } from '@ember/runloop';
const DEBOUNCE_TIME = 200;
export default Ember.Component.extend({
functionCallCount: 0,
_internalFunction() {
this.set('functionCallCount', this.functionCallCount + 1);
import Ember from 'ember';
export default Ember.Component.extend({
init() {
this._super(...arguments);
this._passedOnInit = this.passedValue;
console.log(this.passedValue);
}
});
import Ember from 'ember';
export default Ember.Component.extend({
classNames: ['one'],
didRender() {
this.onRender('one', performance.now());
}
});
import Ember from 'ember';
import A from 'app/mixin/a';
import B from 'app/mixin/b';
export default Ember.Controller.extend(A, {
appName: 'Ember Twiddle',
value: 'nothing',
foo() {
@k-fish
k-fish / components.my-component.js
Created August 6, 2019 20:47
Check dynamic classNames
import Ember from 'ember';
export default Ember.Component.extend({
classNames: ['hello']
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});