Skip to content

Instantly share code, notes, and snippets.

View e00dan's full-sized avatar

e00dan

View GitHub Profile
import Ember from 'ember';
export default Ember.Component.extend({
classNameBindings: ['isSelected:addBorder'],
isSelected: Ember.computed('item', 'selectedItemTitle', function () {
return this.get('item') === this.get('selectedItemTitle');
})
});
import Ember from 'ember';
export default Ember.Component.extend({
actions: {
emailInput(event) {
const $input = $(event.target);
const value = $input.val();
const withoutSpaces = value.replace(/\s+/g, '');
this.set('email', withoutSpaces);
@e00dan
e00dan / mirage.config.js
Last active July 18, 2017 18:20
PromiseObjectIsPendingTemplate
import Ember from 'ember';
export default function () {
window.server = this;
this.timing = 3000;
this.get('/categories');
this.get('/categories/:id');
@e00dan
e00dan / application.controller.js
Last active February 7, 2017 11:04 — forked from joeltrew/application.controller.js
rescursive component
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle',
tree: {
value1: 234,
valueOptions: {
subOption1: 123,
subOption2: 133,
subOption3: 7432,
import Ember from 'ember';
export default Ember.Route.extend({
actions: {
saveClient: function() {
var model = this.modelFor('clients/show');
model.save().then(()=> {
this.transitionTo('clients');
});