21.) What is the role of asyncValidators in Angular forms?
A) They perform synchronous validation
B) They perform asynchronous validation, like checking unique usernames
C) They disable validation temporarily
D) They reset the form
22.) Which lifecycle hook is useful for initializing form data in a component?
A) ngOnChanges
B) ngOnInit
C) ngAfterViewInit
D) ngDoCheck
23.) How do you disable a form control in Reactive forms?
A) control.disable()
B) control.setDisabled(true)
C) control.readOnly(true)
D) control.deactivate()
24.) Which Angular directive is used for two-way data binding in forms?
A) ngFor
B) ngIf
C) formControl
D) ngModel
25.) How do you check if a form is completely valid before submission?
A) form.isComplete()
B) form.isValid()
C) form.valid
D) form.validateAll()
26.) What is the purpose of valueChanges in Angular forms?
A) It listens for changes in the form values
B) It resets the form automatically
C) It validates the form
D) It submits the form
Related