DEV Community

Dhanush
Dhanush

Posted on • Updated on

ngModel in Angular

Image description

In app.component.html:

<input [(ngModel)]="CopyText">
<strong>{{CopyText}}</strong>
<input type="text " value="{{CopyText}}">
Enter fullscreen mode Exit fullscreen mode

The ng-model directive binds the value of HTML controls (input, select, textarea) to application data. With the ng-model directive you can bind the value of an input field to a variable created in Angular. The binding goes both ways. If the user changes the value inside the input field, the Angular property will also change its value

Reference: https://www.c-sharpcorner.com/article/ngmodel-in-angular-with-example/

Latest comments (0)