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({ | |
classNameBindings: ['isSelected:addBorder'], | |
isSelected: Ember.computed('item', 'selectedItemTitle', function () { | |
return this.get('item') === this.get('selectedItemTitle'); | |
}) | |
}); |
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({ | |
actions: { | |
emailInput(event) { | |
const $input = $(event.target); | |
const value = $input.val(); | |
const withoutSpaces = value.replace(/\s+/g, ''); | |
this.set('email', withoutSpaces); |
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 function () { | |
window.server = this; | |
this.timing = 3000; | |
this.get('/categories'); | |
this.get('/categories/:id'); |
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', | |
tree: { | |
value1: 234, | |
valueOptions: { | |
subOption1: 123, | |
subOption2: 133, | |
subOption3: 7432, |
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.Route.extend({ | |
actions: { | |
saveClient: function() { | |
var model = this.modelFor('clients/show'); | |
model.save().then(()=> { | |
this.transitionTo('clients'); | |
}); |