title: Disable Reactive Form Validation when modal is closed
body: <p>I have used a reactive form within a bootstrap modal. When The input is touched the form performs validation.However when I click the x to close the form and the field is touched it performs the validtion and I see the error message and then the form is closed. I understand that the validation happens because the field got touched and lost focus when it's invalid but, I don't want It to perform the validation when I close the form. I don't want to use dirty, because I need that validation when the form is open.How can I overcome this issue?
  here is my field:</p>
  
  <pre><code>&lt;div *ngIf="(direction.dirty || direction.touched)"&gt;
     &lt;!-validation error here-&gt;
  &lt;/div&gt;
  </code></pre>