router / Function

compileRouteData

Take a list of RouteDataDefinition 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

Data -

an object that can be used as the data of an Angular route

Parameters

NameTypeDescription
definitions
RouteDataDefinition<any, any>[]

data records, preferably created via defineRouteData

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,
      }),
    ]),
  },
]