Skip to content

Instantly share code, notes, and snippets.

@csprocket777
Created May 1, 2014 19:34
Show Gist options
  • Save csprocket777/5756f286095475363743 to your computer and use it in GitHub Desktop.
Save csprocket777/5756f286095475363743 to your computer and use it in GitHub Desktop.
Using defineProperty to create a computed property that drives an Ember.Select
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