Sunday, 6 December 2020

Angular MCQ - Angular Fundamentals : Part 1

(1) What object allows you to create your own tokens?

• The Token class

• The InjectionToken class

• The TransparentToken class


(2) What does AOT stand for?

• Assertion of Test

• Android Operating Types

• Ahead of Time


(3) What is the best way to prevent a component from being loaded based on specific conditions?

• Check the condition in the component's constructor.

• Create a route guard and use the "canActivate" property of the component's route.

• Create a route resolver and use the "resolve" property of the component's route.


(4) A promise represents what?

• A single value in the future

• Multiple values in the future

• A single value in the present


(5) What is one way you can pass data from a child component to a parent component?

• You import the parent component into the child component.

• You add an @Input() property on the parent component and bind to it from the child component.

• You add an @Output() property on the child component and bind to it from the parent component.


(6) What does AAA stand for?

• Arrange Act Assert

• Act Arrange Assess

• Act Arrange Assert


(7) What is the main purpose of content projection? 

• Create reusable components with replaceable content

• Allow content to be shown in an overlay

• Improve performance


(8) Which of the following is a valid *ngFor expression?

• event of events

• let event in events

• let event of events


(9) Why does angular not ship with a filterBy or orderBy pipe?

• Those features are implemented in other pieces of the framework.

• To keep the download size small

• They can become performance issues.


(10) How do you inject a service into a component, directive, pipe, or another service?

• Import it and specify it as a parameter in the constructor decorated with the Inject() decorator.

• Import it and decorate the import with an Inject() decorator.

• Import it and specify it as a parameter in the constructor decorated with the Inject() decorator.

No comments:

Post a Comment