Created
April 28, 2015 21:48
-
-
Save benlesh/b9cead6cd91efdb094e6 to your computer and use it in GitHub Desktop.
Car model update thing for jamesarosen
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'; | |
import carSaverCall from 'super/sweet/data-persistance-crap'; | |
export default Ember.Component.extend({ | |
carSaved: function(car) { | |
this.set('carMake', car), | |
} | |
carMake: Ember.computed('model.car', function(key, value) { | |
if(arguments.length > 1) { | |
this._carMake = value; | |
} else { | |
this._carMake = this.get('model.car'); | |
} | |
return this._carMake = value; | |
}), | |
actions: { | |
saveCar: function(car){ | |
carSaverCall(car).then(() => this.trigger('carSaved', car)) | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment