Skip to content

Instantly share code, notes, and snippets.

View GavinJoyce's full-sized avatar

Gavin Joyce GavinJoyce

View GitHub Profile
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
@GavinJoyce
GavinJoyce / components.inner-component.js
Last active October 23, 2017 15:47 — forked from antidis/components.inner-component.js
passing component reference
import Ember from 'ember';
export default Ember.Component.extend({
didInsertElement() {
this._super(...arguments);
this.callFunctionOnReferencedObject();
},
callFunctionOnReferencedObject() {
console.log('api', this.get('api'));
@GavinJoyce
GavinJoyce / components.my-component.js
Last active February 4, 2017 21:07 — forked from paddyobrien/components.my-component.js
closure component bug?
import Ember from 'ember';
export default Ember.Component.extend({
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
@GavinJoyce
GavinJoyce / controllers.application.js
Last active February 2, 2017 20:28 — forked from nolaneo/controllers.application.js
Dynamic key validation
import Em from 'ember';
export default Em.Controller.extend({
useAdditionalValidators: false,
text: '',
hasText: Em.computed.notEmpty('text'),
isNumber: Em.computed('text', function() {
return Em.$.isNumeric(this.get('text'));
}),
import Ember from 'ember';
export default Ember.Component.extend({
actions: {
onChecked: function() {
this.checkboxCb();
}
}
});
import Ember from 'ember';
export default Ember.Component.extend({
actions: {
onChecked: function() {
this.checkboxCb();
}
}
});
import Ember from 'ember';
export default Ember.Component.extend({
});
@GavinJoyce
GavinJoyce / components.my-component.js
Last active November 27, 2016 00:45 — forked from simonihmig/components.my-component.js
hasBlock not available in partial for Ember 2.9.0-beta
import Ember from 'ember';
export default Ember.Component.extend({
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
style: Em.computed('color', function() {
return `background-color: red" onclick="alert(1)"`
})
});