This section includes code snippets and samples that can be used in various
JavaScript files.
Dynamically Creating Components
Create a component dynamically in your client-side JavaScript code by using the $A.createComponent() method. To create multiple components, use $A.createComponents().
Detecting Data Changes with Change Handlers
Configure a component to automatically invoke a change handler, which is a client-side controller action, when a value in one of the component's attributes changes.
Dynamically Showing or Hiding Markup
You can use CSS to toggle markup visibility. However, <aura:if> is the preferred approach because it defers the creation and rendering of the enclosed element tree until needed.