NG.V · Angular 22 practice question

A developer needs to read information associated with the currently active route inside a component. Which service from '@angular/router' should be injected?

import {Component, inject} from '@angular/core';
import {ActivatedRoute} from '@angular/router';

@Component({
  selector: 'app-product',
  template: `<p>Product details</p>`,
})
export class Product {
  private route = inject(ActivatedRoute);
}
Choose one answer
Check answer and explanation

Correct answer: ActivatedRoute

Explanation

ActivatedRoute is the '@angular/router' service that exposes all details associated with the currently active route.

Common trap

RouteConfig is an outdated or non-existent service name for reading live route state in Angular. RouterOutlet is a directive that marks where routed components render in the template, not the service for reading route state.

Source: Angular docs: Read route state — Get information about the current route with ActivatedRoute
Checked against the cited text on 2026-11-25.

Report an error in this question