Rescope
import { Rescope } from 'cx/ui';The Rescope widget enables shorter data binding paths by selecting a common prefix.
ControllerRescope
<Rescope bind="company.specificTeam">
<Text tpl="{manager.name} ({manager.yoe} years of work experience)" />
<br />
<Text tpl="- Leading the team of {size} people" />
</Rescope>Within the scope, outside data may be accessed by using the $root. prefix. For example,
manager and $root.company.specificTeam.manager point to the same object.
Data property
Rescope's data property allows access to the outside data without having to use
the $root. prefix.
ControllerRescope
<Rescope
bind="company.specificTeam"
data={{ address: bind("company.address") }}
>
<Text tpl="{address}" />
<hr />
<Text tpl="{manager.name} ({manager.yoe} years of work experience)" />
<br />
<Text tpl="- Leading the team of {size} people" />
</Rescope>| Property | Description | Type |
|---|---|---|
bind | Prefix path to be used for data binding. Defaults to | string |
data | Outside data that will be carried into this scope. | object |
rootName | Alias used to expose root data. Defaults to | string |