Which directive is used to create a form control in template-driven forms?
- FormControl
- FormGroup
- ngForm
- ngModel
In template-driven forms, the ngModel directive is used to create a form control. It binds form elements like input fields and selects to properties in the component class, allowing two-way data binding.
Loading...
Related Quiz
- How can a parent component communicate with a child component without using @Input or @Output?
- Which Angular CLI command is used to create a new Angular project?
- To execute the Observable and start emitting values, you need to call the _____ method.
- You are building a dashboard and have created a "UserCard" component to display user details. You want this component to display user details differently based on the type of user (Admin, Guest, Registered). Which feature of Angular components can help you achieve this without creating multiple components?
- You are tasked with implementing a sign-up form where the password field must match the confirm password field. Which approach would you use to validate this in Angular?