21.) What symbol is used to separate query parameters in a URL?
22.) How do you redirect a user to another route automatically?
A) { path: ”, redirectTo: ‘/dashboard’, pathMatch: ‘full’ }
B) { path: ”, component: DashboardComponent }
C) { path: ”, redirect: ‘/dashboard’ }
D) { path: ”, navigate: ‘/dashboard’ }
23.) How do you navigate back to the previous page using Angular Router?
A) this.router.navigateBack()
B) this.router.goBack()
C) this.router.previous()
D) this.location.back()
24.) What does routerLinkActive do?
A) Highlights the active link
B) Disables inactive links
C) Redirects users automatically
D) Caches routes
25.) How can you define a default route?
A) { path: ”, component: HomeComponent, pathMatch: ‘full’ }
B) { path: ‘*’, component: HomeComponent }
C) { defaultPath: ‘/’, component: HomeComponent }
D) { redirectTo: ‘/home’ }
26.) What is RouterModule.forRoot(routes) used for?
A) Fetching data from APIs
B) Configuring child routes
C) Defining service dependencies
D) Registering top-level routes
27.) How do you define routes inside a feature module?
A) RouterModule.forRoot(routes)
B) RouterModule.forChild(routes)
C) RouterModule.define(routes)
D) FeatureModule.configRoutes(routes)
28.) What is the purpose of params in route configuration?
A) To pass dynamic values in a route
B) To create child routes
C) To define default routes
D) To fetch API data
Related