11.) What is the purpose of ViewChild in Angular?
A) To get a reference to a child component or DOM element
B) To define a component as a child of another
C) To pass data from a child to a parent
D) To create a new component dynamically
12.) How can two unrelated components communicate in Angular?
A) Using @Input
B) Using @Output
C) Using a shared service
D) Using local variables
13.) What happens if a component is not declared in an Angular module?
A) It will throw an error
B) It will still work
C) It will be converted into a directive
D) It will be ignored by Angular
14.) What happens when a component is destroyed?
A) It gets hidden but remains in memory
B) It is removed from the DOM and memory
C) It stops receiving input properties
D) It only removes its template but keeps its logic in memory
15.) What is the main benefit of OnPush change detection strategy?
A) It improves performance by reducing unnecessary checks
B) It allows direct DOM manipulation
C) It runs change detection continuously
D) It disables change detection
16.) What is the primary use of Angular services?
A) To create reusable components
B) To define routes in the application
C) To manage application data and business logic
D) To apply CSS styling
17.) What is the correct way to pass data to a child component?
A) Using @ViewChild
B) Using @Input
C) Using @Output
D) Using a service
18.) What happens if you use @Input() in a parent component?
A) The child component will receive data
B) The parent component will receive data
C) The application will crash
D) It has no effect
19.) What does @Output in Angular do?
A) Allows a parent component to pass data to a child component
B) Allows a child component to send data to its parent component
C) Creates a new component dynamically
D) Performs dependency injection
20.) How do you trigger an event using EventEmitter in Angular?
A) this.eventName.trigger()
B) this.eventName.send()
C) this.eventName.emit(value)
D) this.eventName.broadcast(value)
Related