Skip to content

Instantly share code, notes, and snippets.

View GavinJoyce's full-sized avatar

Gavin Joyce GavinJoyce

View GitHub Profile
@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.Controller.extend({
appName: 'Ember Twiddle'
});
@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({
});
@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'));
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});