An InjectionToken provided by the RouterOutlet and can be set using the routerOutletData input.
API
const ROUTER_OUTLET_DATA: InjectionToken<Signal<unknown>>;
Description
An InjectionToken provided by the RouterOutlet and can be set using the routerOutletData input.
When unset, this value is null by default.
Usage Notes
To set the data from the template of the component with router-outlet:
<router-outlet [routerOutletData]="{name: 'Angular'}" />
To read the data in the routed component:
data = inject(ROUTER_OUTLET_DATA) as Signal<{name: string}>;