Which directive is used in Angular for two-way data binding in template-driven forms?
- (ngBind)
- [(ngModel)]
- [bind]
- {{ngBind}}
In template-driven forms, [(ngModel)] is used for two-way data binding. It allows you to bind the value of an input field to a model property, so changes to the input field are reflected in the model and vice versa. [(ngModel)] is a key directive for achieving this bi-directional data flow.
Loading...
Related Quiz
- Which option is NOT a valid view encapsulation mode in Angular?
- To apply multiple structural directives to one element, you would typically use ________.
- In an e-commerce application, you want to ensure that product details fetched from the server are not requested again for a certain period. Which technique would be effective for this scenario?
- The class that represents a group of FormControl instances in reactive forms is ______.
- To apply styles scoped to a particular component and prevent them from affecting other elements outside the component, you would use _____.