Angular2: How do you mark FormGroup control dirty via `patchValue()` : <p>I am updating a Reactive <code>FormGroup</code> control value from my component via <a href="https://angular.io/docs/ts/latest/api/forms/index/FormGroup-class.html#!#patchValue" rel="noreferrer">patchValue</a>.</p>

<p>Ex:</p>

<pre><code>this.myForm.patchValue({incidentDate:'2016-09-12');
</code></pre>

<p>This works great and triggers a <code>valueChanges</code> event, however this control's <code>dirty</code> property is still <code>false</code>.</p>

<p>I need the <code>incidentDate</code> control to be <code>dirty</code> so my validation logic knows to run against this control.</p>

<p>How do I update the value of a control from my component AND indicate that it is dirty?</p>

<p>Here is my validation logic:</p>

<pre><code>onValueChanged(data?: any) {
    if (!this.myForm) {
      return;
    }
    const form = this.myForm;
    for (const field in this.formErrors) {
      // clear previous error message (if any)
      this.formErrors[field] = '';
      const control = form.get(field);
      if (control &amp;&amp; control.dirty &amp;&amp; !control.valid) {
        const messages: any = this.validationMessages[field];
        for (const key in control.errors) {
          this.formErrors[field] += messages[key] + ' ';
        }
      }
    }
}
</code></pre>
