In app.component.html:
<input [(ngModel)]="CopyText">
<strong>{{CopyText}}</strong>
<input type="text " value="{{CopyText}}">
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/
Top comments (0)