Value providers are a way to access data. Value providers encapsulate related values together, similar to how an object encapsulates properties and methods.
The value providers for a component are v (view) and c (controller).
Value Provider
Description
See Also
v
A component’s attribute set. This value provider enables you to access the value of a component’s attribute in the component’s markup.
All components have a v value provider, but aren’t required to have a controller. Both value providers are created automatically when defined for a component.
Expressions are bound to the specific component that contains them. That component is also known as the attribute value provider, and is used to resolve any expressions that are passed to attributes of its contained components.
Note
Global Value Providers
Global value providers are global values and methods that a component can use in expressions.
Global Value Provider
Description
See Also
globalID
The globalId global value provider returns the global ID for a component. Every component has a unique globalId, which is the generated runtime-unique ID of the component instance.
Values in a value provider are accessed as named properties. To use a value, separate the value provider and the property name with a dot (period). For example, v.body. You can access value providers in markup or in JavaScript code.
When an attribute of a component is an object or other structured data (not a primitive value), access the values on that attribute using the same dot notation.
For example, {!v.accounts.id} accesses the id field in the accounts record.
For deeply nested objects and attributes, continue adding dots to traverse the structure and access the nested values.