Interface Route<S>

Interface describing the shape of a Route. A Route must consist of at least a path and may specify a component, as well as slots, which will be rendered into the RouterOutlet when the Route is Router.navigated to. Furthermore a Route may also specify children.

Example

Define a Route:

import { type Route } from '@sgrud/shell';

const route: Route = {
path: '',
component: 'example-element',
children: [
{
path: 'child',
component: 'child-element'
}
]
};

See

Router

interface Route<S> {
    children?: Route<string>[];
    component?: CustomElementTagName;
    constructor: any;
    path: S;
    slots?: Record<string, CustomElementTagName>;
}

Type Parameters

  • S extends string = string

    The Route Route.path string type.

Constructors

Properties

Constructors

constructor

Properties

children?: Route<string>[]

Optional array of children for this Route.

Optional Route component.

path: S

Required Route path.

slots?: Record<string, CustomElementTagName>

Optional mapping of elements to their slots.

Generated using TypeDoc