Given a controller like:
App.SignInController = Ember.Controller.extend
authenticated: false
authenticatedDidChange: (() =>
console.log @get('authenticated')
).observes('controller.authenticated')
This doesn't seem to work so I must not understand how observers works. I think it is supposed to created an observer on controller.authenticated. However when I call @set("authenticated", true) nothing is logged.
Updated:
I did try replacing controller.authenticated with App.signInController.authenticated to no avail.
What am I missing?
Eventually I stumbled upon an answer this Yehuda Katz on Quora.
After reviewing this answer I noticed that the
observescall only specifies the name of the property with nocontrollerorApp.signInControllerprefix. Changing my solution above to justobserves('authenticated')works.