Created
May 1, 2014 19:34
-
-
Save csprocket777/5756f286095475363743 to your computer and use it in GitHub Desktop.
Using defineProperty to create a computed property that drives an Ember.Select
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
setupExistingParams: function(){ | |
Ember.defineProperty(this, 'record_phase', Ember.computed('record_workflow_segment_step_params.[]', function(key, value){ | |
if( this.get('step_type').toString() !== "1" ){ | |
return undefined; | |
} | |
var param = this.get('record_workflow_segment_step_params').findBy('name', 'record_phase'); | |
if( !Ember.isNone( value ) ) | |
{ | |
param.set('value', value); | |
} | |
return param.get('value').toString(); | |
})); | |
}.on('init') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment