Loading

Quipoin Menu

Learn • Practice • Grow

angular / Component Communication
mcq
Direction: Choose the correct option

Q1.

How do you pass data from a parent component to a child component?
A. Using @Output decorator
B. Using @Input decorator
C. Using services
D. Using EventEmitter
Direction: Choose the correct option

Q2.

How does a child component send data to a parent component?
A. Using @Output with EventEmitter
B. Using @ViewChild
C. Using @Input
D. Using @ContentChild
Direction: Choose the correct option

Q3.

What is the role of `EventEmitter` in component communication?
A. To manage state
B. To emit custom events from a child component
C. To handle HTTP requests
D. To listen to DOM events
Direction: Choose the correct option

Q4.

How can sibling components communicate?
A. Using @ViewChild
B. Directly using @Input/@Output
C. Through a shared service
D. Through the parent component
Direction: Choose the correct option

Q5.

What does `@ViewChild` allow you to do?
A. Create a view
B. Project content
C. Inject a service
D. Access a child component or DOM element from the parent
Direction: Choose the correct option

Q6.

What is `@ContentChild` used for?
A. To access projected content from a parent component
B. To access view children
C. To access routes
D. To access services
Direction: Choose the correct option

Q7.

What does the `@Output` decorator require?
A. A string
B. An instance of EventEmitter
C. A boolean
D. A number
Direction: Choose the correct option

Q8.

How do you listen to a custom event emitted by a child?
A. `@Input` event
B. `@ContentChild` subscription
C. `@ViewChild` subscription
D. `(myEvent)='handle($event)'` in parent template
Direction: Choose the correct option

Q9.

What is the purpose of `@ViewChildren`?
A. To get a query list of multiple child components/elements
B. To get all directives
C. To get all services
D. To get a single child
Direction: Choose the correct option

Q10.

Can a component communicate with its great-grandparent directly?
A. Only with @Output
B. Only with @Input
C. Yes, via services or state management
D. No, only with direct parent