Developing Secure Code
Testing Components
createComponent()
createComponents()
enqueueAction()
error()
get()
getCallback()
getComponent()
getReference()
getRoot()
getToken()
log()
reportError()
run()
set()
warning()
Previous PDF Versions
The $A namespace is the entry point for using the framework in JavaScript code.
Create a component from a type and a set of attributes. This method accepts the name of a type of component, a map of attributes, and a callback to notify the caller.
Create an array of components from a list of types and attributes. This method accepts a list of component names and attribute maps, and a callback to notify the caller.
Queue a call to an Apex action . The framework queues up actions before sending them to the server. This mechanism is largely transparent to you when you’re writing code but it enables the framework to minimize network traffic by batching multiple actions into one request (XHR).
Deprecated. For a serious error that has no recovery path, throw a standard JavaScript error instead by using throw new Error(msg).
Returns a value from the specified global value provider using property syntax.
Use $A.getCallback() to wrap any code that modifies a component outside the normal rerendering lifecycle, such as in a setTimeout() call. The $A.getCallback() call ensures that the framework rerenders the modified component and processes any enqueued actions.
Gets an instance of a component from either a global ID or a DOM element that was created by a rendered component.
Returns a live reference to the global value requested using property syntax.
Gets the root component or application. For example, $A.getRoot().get("v.attrName") returns the value of the attrName attribute from the root component.
Returns an application configuration token referenced by name. A tokens file is configured with the tokens attribute in the <aura:application> tag.
Deprecated. Logs to the browser’s JavaScript console, if it is available. This method doesn’t log in production or debug modes so it’s only useful for internal usage by the framework.
Report an error to the server after handling it. Note that the method should be used only if the try-catch mechanism of error handling is not desired or not functional, such as in nested promises.
Deprecated. Use getCallback() instead.
Sets a value on the specified global value provider using property syntax.
Deprecated. Logs a warning to the browser’s JavaScript console, if it is available.