、
labeltext:Ember.computed('conditionVar',function(){
var val = this.get('conditionVar');
if(Ember.isEqual(val,'conditionA')){
return 'Wow';
}
else if(Ember.isEqual(val,'conditionB')) {
return 'Thanks';
}
return 'Hello';
})
あなたが計算プロパティのゲッターとセッターを持っているかもしれませんが、
labeltext: Ember.computed('conditionVar', function() {
get(key){
var val = this.get('conditionVar');
if (Ember.isEqual(val, 'conditionA')) {
return 'Wow';
}else if (Ember.isEqual(val, 'conditionB')) {
return 'Thanks';
}
return 'Hello';
},
set(key, value){
// you can set conditionVar so that it will return the same value when you request it again.
if(value === 'Wow') {
this.set('conditionVar', 'conditionA');
}
else if(value === 'Thanks') {
this.set('conditionVar', 'conditionB');
}
return value;
}
}),
公式ガイド参照してください:https://guides.emberjs.com/v2.3.0/object-model/computed-properties/
を