DEV Community


Posted on • Updated on


ngModel in Angular

Image description

In app.component.html:

<input [(ngModel)]="CopyText">
<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


Top comments (0)

50 CLI Tools You Can't Live Without

>> Check out this classic DEV post <<