0Pricing
Angular Academy · Lesson

Resolvers and Route Data

Preload data before activating a route.

What is a resolver

A resolver pre-fetches data before a route activates, so the component renders with data already available — no loading flash in the component itself.

Static route data

The data property attaches static values to a route, readable via ActivatedRoute.data.

export const routes = [
  { path: 'admin', component: AdminComponent,
    data: { title: 'Admin Panel', roles: ['admin'] } }
];

All lessons in this course

  1. Route Parameters and Query Params
  2. Resolvers and Route Data
  3. Functional Route Guards
  4. Router Events and Navigation
← Back to Angular Academy