Skip to content

Route Data

Route data allows passing static configuration to components through the route definition.

{
path: 'products',
component: ProductListComponent,
data: { title: 'Products', roles: ['admin', 'user'] }
}
// Component
this.route.snapshot.data['title'];

Route data provides a clean way to pass configuration to routed components.”