This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Component.extend({ | |
fruits: null, | |
selectedId: null, | |
init() { | |
this._super(...arguments); | |
this.fruits = [ | |
{ id: 1, name: 'apple' }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Component from '@ember/component'; | |
import { computed } from '@ember/object'; | |
import { scheduleOnce } from '@ember/runloop'; | |
const { max, pow } = Math; | |
const FONT_SIZES = Object.freeze([null, null, null, 34, 26]); | |
export default Component.extend({ | |
tagName: '', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)', | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
shouldRenderComponent: false, | |
actions: { | |
renderComponent() { | |
this.toggleProperty('shouldRenderComponent'); | |
}, | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
shouldRenderComponent: false, | |
actions: { | |
renderComponent() { | |
this.toggleProperty('shouldRenderComponent'); | |
}, | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle', | |
accordion: Ember.inject.service(), | |
actions: { | |
expandAll() { | |
let accordion = this.get('accordion'); | |
console.log('accordion', accordion); | |
console.log('expand all'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Component.extend({ | |
configuration: undefined, | |
actions: { | |
onExpand(item) { | |
item.toggleProperty('isExpanded'); | |
}, | |
}, | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
license: gpl-3.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
license: gpl-3.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
const { computed } = Ember; | |
export default Ember.Controller.extend({ | |
goldenRatioWidth: Ember.computed('height', { | |
get(key) { | |
return this.get('height') * 1.618; | |
}, | |
set(key, value) { | |
this.set('height', value / 1.618); |
NewerOlder