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
// components/accordion-item.js | |
import Ember from 'ember'; | |
export default Ember.Component.extend({ | |
item: null, | |
activeItem: null, | |
isExpanded: Ember.computed('activeItem', 'item', function() { | |
return this.get('activeItem') === this.get('item'); |
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 { $, get, set, run } = Ember; | |
export default Ember.Component.extend({ | |
// Defaults | |
classNames: ['Experiment-ratio'], |
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({ | |
}); |
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 { Route: EmberRoute } = Ember; | |
export default EmberRoute.extend({ | |
// Defaults | |
// Single line CP |
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', | |
user: null, | |
init(){ | |
this._super(); | |
const user = this.get('store').createRecord('user', {email: 'akram@'}); | |
this.set('user', user); | |
}, |
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', | |
user: null, | |
init(){ | |
this._super(); | |
const user = this.get('store').createRecord('user', {email: 'akram@'}); | |
this.set('user', user); | |
}, |
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({ | |
// Defaults | |
// Single line CP | |
// Multiline CP |
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 { $ } = Ember; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle', | |
actions: { | |
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 Changeset from 'ember-changeset'; | |
const { get, set } = Ember; | |
const Rule = Ember.Object.extend({ | |
name: 'foo', | |
description: 'bar' | |
}); |
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 _math from 'lodash/math'; | |
const { computed, get } = Ember; | |
export default Ember.Controller.extend({ | |
ratios: computed.mapBy('experiments', 'ratio'), | |
totalofExperimentRatios: computed.sum('ratios'), | |
controlRatio: computed('totalofExperimentRatios', function () { | |
return this._controlRatio(); |