title: Angular 4 - Login Form
body: <p>I have a login form as such: </p>
  
  <pre><code> &lt;form [formGroup]="loginForm" (ngSubmit)="login();" novalidate&gt;
          &lt;table&gt;
              &lt;tr&gt;
                  &lt;td&gt; Username: &lt;/td&gt;
                  &lt;td&gt; &lt;input type="text" formControlName="username"&gt;&lt;/td&gt;
              &lt;/tr&gt;
              &lt;tr&gt;
                  &lt;td&gt; Password: &lt;/td&gt;
                  &lt;td&gt; &lt;input type="password" formControlName="password"&gt;&lt;/td&gt;
              &lt;/tr&gt;
  
              &lt;tr&gt;
                  &lt;td&gt; &lt;/td&gt;
                  &lt;td&gt; &lt;button type="submit" [disabled]="loginForm.pristine" md-raised-button&gt;Login&lt;/button&gt;&lt;/td&gt;
              &lt;/tr&gt;
          &lt;/table&gt;
  
  &lt;/form&gt;
  </code></pre>
  
  <p>On the submit button, I have [disabled]="loginForm.pristine". But when I type something in either of the input field and backspace to delete everything, it loses it's "pristine" status. How do I handle this?</p>