
Which directive is used to create a two way data binding in Angular?
Published on:March 6, 2025Duration:0:06Views:384 viewsLikes:13 likesComments:3 comments
Which directive is used to create a two way data binding in Angular In Angular, the ngModel directive is used to create two-way data binding. It allows synchronization between the model (component's data) and the view (UI). Explanation: [(ngModel)] enables two-way binding by combining property binding ([ngModel]) and event binding ((ngModelChange)). Any changes in the input field automatically update the userName variable, and vice versa.