I want to set a property of ApplicationController from within App.ready. But I don’t see how this can be done from within this function
App.ready = function() {
this.controller.set("isLoaded", true) ;
}
Is something like this possible ?
CHeers
It’s not really possible to set controller values directly if the objects aren’t directly linked (Router > Controller > View), but I would also question why you wish to set something in the ApplicationController from the ready event. There are two options that you can take. Either you can create a new Ember object and set a value from the ready event there, and have the controller observe that property (example here. The second option is to respond to the ‘didInsertElement’ event on the ApplicationView (an example is here)
Option 1:
Option 2:
EDIT: Note that I’m pretty sure option 1 is messy and will be frowned upon by the Ember devs (although I can’t say for certain).