Sunday, November 7, 2021

Angular2 Routing

 The Angular Router enables navigation from one view to the next as users perform application tasks [Angular v2 Archive]. Below are Angular2 Routing questions & answers for interviews and other exams.


1. The . . . . . . . . . . . . is a highly configurable and feature-packed router. Features included are standard view routing, nested child routes, named routes, and route parameters.

A) Distinctive Router
B) Component Router
C) Angular Router
D) Creative Router

2. The . . . . . . . . . . directive is used to display views for a given route.

A) RouterAngle
B) RouterLink
C) RouterState
D) RouterOutlet

3. RouterModule.forChild creates a module that contains all the directives and the given routes, and the router service.

A) True
B) False

4. The . . . . . . . . . directive substitutes the normal href property and makes it easier to work with route links in Angular 2. Moreover if we want to navigate between routes, we use the . . . . . . . . . . . directive.

A) RouterLinks
B) RouterLinking
C) RouterLink
D) RouterLinq

5. Three main components of Routing are . . . . . . . . . . .

A) RouteObject
B) RouterOutlet
C) RouterState
D) RouterLink

6. It contains the information about a route associated with a component loaded in an outlet. An . . . . . . . . . . can also be used to traverse the router state tree.

A) ActivatedRoute
B) NavigationRoute
C) NavigateRoute
D) ActiveRoute

7. Route . . . . . . . . . . allow us to pass values in our url to our component so we can dynamically change our view content.

A) pipes
B) modules
C) variables
D) parameters

8. . . . . . . . . . . . ​is nothing but the directive which is provided by the RouterModule. The main role of . . . . . . . . . is that the router will display each and every component immediately below router-outlet.

A) router­resolve
B) router­outlet
C) router­intlet
D) router­guard

9. In Angular 2 . . . . . . . . . . represents an event triggered when a navigation starts.

A) RouteStart
B) RouteInitial
C) NavigationStart
D) NavigateStart

10. There are four different guard types we can use to protect our routes, one of these is

A) CanLoad
B) CanStart
C) CanNavigate
D) CanStop

Answers
1) b, 2) d, 3) b, 4) c, 5) a,b,d, 6) a, 7) d, 8) b, 9) c, 10) a

No comments:

Post a Comment

Get max value for identity column without a table scan

  You can use   IDENT_CURRENT   to look up the last identity value to be inserted, e.g. IDENT_CURRENT( 'MyTable' ) However, be caut...