Which method is used to add a new control to a FormGroup in reactive forms?
- addControl()
- createControl()
- insertControl()
- pushControl()
In reactive forms, you use the addControl() method to add a new control to a FormGroup. This method allows you to dynamically add form controls to a FormGroup, which can be useful when you need to create form controls based on user interactions or other dynamic criteria.
Loading...
Related Quiz
- How can you bind an event to a button click in Angular?
- In terms of performance optimization, why is Ahead-of-Time (AOT) compilation beneficial for Angular applications?
- Which RxJS operator is best suited for handling side effects?
- In what scenario might you need to use both ComponentFactoryResolver and ViewContainerRef together?
- What is the purpose of using *ngIf in Angular templates?