Routing & Navigation Flashcards
6 cards from real Angular Web Framework practice questions. Tap to flip, then mark Knew It or Still Learning โ missed cards come back until you master them.
Read the first 6 Routing & Navigation flashcards as text
What is the Angular Router?
Answer: A module that maps URL paths to components, enabling single-page application navigation
The Angular Router maps URL paths to specific components, enabling navigation between different views in a single-page application without full page reloads.
What is a route guard in Angular?
Answer: An interface that controls whether navigation to or from a route is allowed
Route guards (CanActivate, CanDeactivate, CanLoad) are classes implementing specific interfaces that determine whether navigation should proceed, commonly used for authentication and authorization.
What are lazy loaded modules?
Answer: Feature modules loaded on demand when their route is first accessed, reducing initial bundle size
Lazy loading defers loading of feature modules until the user navigates to their routes, reducing the initial application bundle size and improving startup performance.
What is the ActivatedRoute service?
Answer: A service providing access to route parameters, query parameters, and other route information
ActivatedRoute provides information about the route associated with the loaded component, including route parameters, query strings, URL fragments, and resolved data.
What is the purpose of the router outlet?
Answer: A placeholder directive in the template where routed components are dynamically rendered
The directive acts as a placeholder in the layout template where the Angular Router dynamically renders the component matching the current URL path.
How do you pass parameters in Angular routes?
Answer: Using path parameters (:id), query parameters (?key=value), or route data
Angular supports path parameters (/user/:id), query parameters (/search?term=angular), and resolved route data for passing information to routed components.