ngModel

When we apply the ngModel directive on an input field, Angular creates a form control object under the hood and associates that with this input field.

<div class="form-group">
    <textarea 
      name="questionAnswer" 
      rows="3"
      class="form-control mt-3"
      [(ngModel)] = "answer"></textarea>
  </div>
<p class="mt-2">Your reply: {{ answer }}</p>

TS

answer = '';
Was this page helpful?