Skip to content

Instantly share code, notes, and snippets.

Avatar
💩

Matt Wright TRMW

💩
View GitHub Profile
View components.my-checkbox.js
import Ember from 'ember';
export default Ember.Component.extend({
tagName: 'label'
});
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
@TRMW
TRMW / controllers.application.js
Last active May 3, 2018
Forced Checkbox Example
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
isSelectedAll: false,
isIndeterminate: true,
options: [
Ember.Object.create({
label: 'First',
isSelected: false
View components.selection-modal.js
import Ember from 'ember';
export default Ember.Component.extend({
isSelectedAll: false,
isIndeterminate: false,
didReceiveAttrs(...args) {
this._super(...args);
this.updateSelectAllState();
},
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
isSelectedNone: false,
options: Ember.computed(function() {
return [
{
label: 'First',
isSelected: true
View components.my-component.js
import Ember from 'ember';
export default Ember.Component.extend({
actions: {
myAction() {
this.sendAction('passedAction');
}
}
});
View components.my-component.js
import Ember from 'ember';
export default Ember.Component.extend();
@TRMW
TRMW / components.my-component.js
Last active Feb 15, 2017
Additive class vs. classNames
View components.my-component.js
import Ember from 'ember';
export default Ember.Component.extend({
classNames: ['base-class'],
style: 'border: solid 2px blue'
});
View components.my-select.js
import Ember from 'ember';
export default Ember.Component.extend({
classNameBindings: ['includeBaseStyling:input-select'],
includeBaseStyling: true,
content: null,
optionValuePath: 'value',
optionLabelPath: 'label',
disabled: false,
useOptionsAsValues: false,
@TRMW
TRMW / components.my-component.js
Last active Jan 6, 2017
boolean draggable attribute bug
View components.my-component.js
import Ember from 'ember';
export default Ember.Component.extend({
attributeBindings: ['foo', 'draggable', 'bar'],
foo: false,
draggable: false,
bar: false
});
You can’t perform that action at this time.