Skip to main content

Reads the context of the closest enclosing component of another type.

Use it when a nested component needs something from an ancestor, for example a custom button inside a dialog:

<ui:context name="dialog" as="dialogContext" />

name is the camelCase name of the enclosing component and as the variable that receives its context. A component reads its own context through the context variable. Asking ui:context for it throws an exception.

Name Type Description Required Default
name string The camelCase base name of the component of which we want the context (e.g. "fileUpload") Yes -
as string Variable name to assign the result to No ''