I am new in angular 6 and working on a angular project.I am facing a problem while reset the form after submission of the form.Here is code:
<form [formGroup]="commentForm">
<div class="col-md-8 " [ngClass]="{ 'is-invalid': submitted && f.comment.errors }">
<textarea class="form-control" [(ngModel)]="commentsData.comment" [ngClass]="{ 'is-invalid': submitted && f.comment.errors }" formControlName="comment" placeholder="Add a Comment..." rows="5" cols="8"> </textarea>
</div>
</form>
in components.ts file i am using this for reset the form
this.commentForm.reset();
Form values are cleared successfully,but only problem is after reset form field border is in red color. I am trying
this.commentForm.markAsPristine();
But nothing helps