Skip to content

Instantly share code, notes, and snippets.

@fhrbek
fhrbek / components.my-component.js
Created February 1, 2019 11:27 — forked from MichalBryxi/components.my-component.js
Dynamic computed property path - v03
import Ember from 'ember';
import {computed} from '@ember/object';
export default Ember.Component.extend({
magicName: 'foo',
foo: 'I am foo',
bar: 'I am bar (not really necessary)',
@fhrbek
fhrbek / controllers.application.js
Created February 1, 2019 10:48 — forked from MichalBryxi/controllers.application.js
Dynamic computed property path - v01
import Ember from 'ember';
import {computed} from '@ember/object';
function magicFunc () {
let name = this.get('magicName');
let value = this.get(name);
console.log('NAME', name, 'VALUE', value);
Ember.run.next(() => {
this.set('magicValue', Ember.computed('magicName', name, magicFunc));
@fhrbek
fhrbek / controllers.application.js
Last active March 29, 2017 09:20
Slow Route with loading event
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Randomly Slow Route Demo'
});
@fhrbek
fhrbek / controllers.application.js
Last active April 3, 2017 10:32
Slow Route with loading state
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Randomly Slow Route Demo'
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Randomly Slow Route Demo'
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
textSamples: [
[
'This is quite a long text',
'A short text',
'MMMMMMMMMMMMMMIIIIIIIIIIIIIII',
@fhrbek
fhrbek / controllers.application.js
Last active May 5, 2016 12:23
Datetime Range Picker - copy on change
import Ember from 'ember';
import DatetimeObject from '../datetime-input/datetime-object';
import DatetimeRangeObject from '../datetime-range-input/datetime-range-object';
export default Ember.Controller.extend({
appName: 'PE Datetime Range Selector Demo',
datetimeRange: DatetimeRangeObject.create(),
init () {
@fhrbek
fhrbek / controllers.application.js
Last active April 18, 2016 10:57
Datetime Range Picker with Chrono
import Ember from 'ember';
import DatetimeObject from '../datetime-input/datetime-object';
import DatetimeRangeObject from '../datetime-range-input/datetime-range-object';
export default Ember.Controller.extend({
appName: 'PE Datetime Range Selector Demo',
datetimeRange: DatetimeRangeObject.create(),
init () {
@fhrbek
fhrbek / controllers.application.js
Last active April 18, 2016 09:57
PE Datetime Range Selector - dev
import Ember from 'ember';
import DatetimeObject from '../datetime-input/datetime-object';
import DatetimeRangeObject from '../datetime-range-input/datetime-range-object';
export default Ember.Controller.extend({
appName: 'PE Datetime Range Selector Demo',
datetimeRange: DatetimeRangeObject.create(),
init () {
@fhrbek
fhrbek / controllers.application.js
Last active April 14, 2016 22:56
DDAU Pattern - Hybrid
import Ember from 'ember';
import Person from '../ddau-objects/person';
import Name from '../ddau-objects/name';
const presets = [
Person.create({
firstName: Name.create({value: 'John'}),
lastName: Name.create({value: 'Doe'})
}),
Person.create({