Quantcast
Channel: Ember.JS - Latest topics
Viewing all articles
Browse latest Browse all 4870

Controller toggle button and message

$
0
0

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! :slight_smile: //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

Read full topic


Viewing all articles
Browse latest Browse all 4870

Trending Articles