Hi guys I am new to Ember and when I toggle the isButtonOn the message does not change, any guidance in the right direction would be appreciated!
//controller/app.js
import Ember from ‘ember’;
const { get, set, computed } = Ember;
export default Ember.Controller.extend({ isButtonOn: false,
toggle () { set(this,‘isButtonOn’,!this[‘isButtonOn’]) // this.toggleProperty(‘isButtonOn’) console.log(this.isButtonOn) }, text: computed(function () {
return get(this, 'isButtonOn') ?
'Message 1 the button is on' :
'Message 2 the button os off';
}), });
2 posts - 2 participants