Multiple Choice Questions - Angular 2 Events

Multiple Choice Questions - Angular 2 Events

1. Event binding can be defined . . . . . . . . .

A) by wrapping the event in (parenthesis)
B) by prefixing it with in-
C) by wrapping the event in {curly brackets}
D) by prefixing it with on-

2. EventEmitter class acts both as an observer and observable.

A) True
B) False

3. Events in Angular 2 behave like normal DOM events. They can bubble up but cannot propagate down.

A) True
B) False

4. EventEmitter class’s simple interface, which basically encompass two methods . . . . . . . . . can therefore be used to trigger custom events and listen to events as well, both synchronously or asynchronously.

A) exit()
B) superscript()
C) subscribe()
D) emit()

5. Angular framework provides event binding using in-built event as well as custom event. Custom events are the EventEmitter instances. To create a custom event we need to create an instance of EventEmitter annotated by . . . . . . .

A) @Input()
B) @Get()
C) @Output()
D) @Set()

6. EventEmitter class is used by directives and components to emit custom Events.

A) True
B) False

7. @Output() myEvent = new EventEmitter();

A) Declares an output property that fires events that you cannot subscribe to with an event binding.
B) Declares an output property that fires events that you can subscribe to with an event binding.
C) Declares an output property that overrides events that you can subscribe to with an event binding.
D) Declares an output property that subscribes events that you can subscribe to with an event binding.

8. . . . . . . . . need to be passed as a parameter in the event callback from the template to capture the event object.

A) $event.start
B) $events
C) $eventobj
D) $event

9. Calling . . . . . . . . on the event prevents propagation.

A) stopEventPropagation
B) preventEventPropagation
C) stopPropagation
D) preventPropagation

10. Events on child elements are propagated upwards, and hence event binding is also possible on a parent element.

A) True
B) False

Answers