Newer Version Available
Invoking Actions on Component Initialization
Use the init event to initialize a component or
fire an event after component construction but before rendering.
Let’s look at an example.
The magic happens in this line.
This code registers an init event handler for the component. init is a predefined event sent to every component. Setting value="{!this}" marks this as a value event. You should always use this setting for an init event.
After the component is initialized, the doInit action is called in the component’s controller.
The doInit action sets an attribute value, but it could do something more interesting, such as firing an event.
If a component is contained in another component or app, the inner component is initialized first.