This file contains 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, typeOf } = Ember; | |
export default Ember.Component.extend({ | |
value: computed({ | |
set(param,setter,previousValue) { | |
console.log('VALUE: CP setter value: %o. Previous value had been: %o', setter, previousValue); | |
switch(typeOf(setter)) { | |
case "string": | |
// returns a string but can pass back different outcome than what sent in |
This file contains 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); |
This file contains 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 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 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 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 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 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 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 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: '', |
OlderNewer