compileRouteData
Take a list of
and compile them into an object that can be accepted as the data field of an Angular route, so that these data records can be retrieved later.
See Also
Presentation
function compileRouteData (definitions: RouteDataDefinition <any, any>[]): Data ;
Returns
Parameters
Name | Type | Description |
---|---|---|
definitions |
| data records, preferably created via |
Example usage
export const NAV_STATUS = new RouteDataToken <NavStatus>("NAV_STATUS");
export const PAGE_ROUTES: Routes = [
{
path: "",
component: PageComponent,
data: compileRouteData ([
defineRouteData ({
token: NAV_STATUS,
value: NavStatus.Collapsed,
}),
]),
},
]