Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting a controller property on application controller after application ready

Tags:

ember.js

I am trying to set my main application view headline to the current company name. Which I need to fetch via ajax "/company.json".

In my ApplicationController I have a "companyName" property and a method called "loadCompanyName" that will fetch the companyName. The question is, How do I reference this instanced controller from the Application ready function.

like image 609
davydotcom Avatar asked Jan 15 '13 13:01

davydotcom


People also ask

How do I configure the application control functionality?

You configure the Application Control functionality within the Application Control Configuration Editor. This can be accessed from one of a few places within the Security Controls console. • New > Agent Policy > Application Control > New. Note this will assign the configuration to the policy once saved.

How do I add controls to my App?

Select Label or Button to add one of those types of controls. Select a category of controls, and then select the type of control that you want to add. For example, select New screen, and then select Blank to add a blank screen to your app. (Screens are a type of control that can contain other types of controls.)

How do I configure a control?

Configure the appearance and behavior of a control by setting one of its properties. Each type of control has a different set of properties. Some properties, such as Height and Width, are common to almost every type of control, but other properties, such as CheckboxSize, are specific to one type of control.

How does application control protect my files?

Application Control makes use of the industry standard SHA-1, SHA256 and Adler-32 hashes. If the file is altered in any way, then the hash is also altered. Digital hashing is seen as the ultimate security method because it is accurate. It identifies each file independently of all other factors other than the file itself.


1 Answers

With the new one you should prefer to do it in the the App.ready() function.

Usuallly I would do it in the setupController() function of the ApplicationRoute:

App.ApplicationRoute = Ember.Route.extend({
  setupController: function(controller, model){
    controller.loadCompanyName();
    this._super(controller, model);
  }
});
like image 104
sly7_7 Avatar answered Nov 15 '22 08:11

sly7_7