Router Events
Explain the Router's event stream and how to use it for loading indicators, analytics, and scroll restoration.
The Router emits a sequential stream of events for every navigation attempt — NavigationStart, various guard/resolve events, NavigationEnd, NavigationCancel, NavigationError, among others — exposed as an Observable on the injected Router service's .events property. Interviewers ask about this because it's the mechanism behind several very common, very visible app features: top-of-page loading bars, page-view analytics tracking, and scroll-position restoration.
It's like an airport's flight status board broadcasting every stage of a flight — boarding, departed, delayed, landed, cancelled — letting anyone (an app displaying arrivals, a family tracking a relative's flight) react to exactly the milestones they care about without needing direct radio contact with the cockpit.