title: How to set the input field to invalid without using forms so that the bottom outline appears red based on a condition
body: <p>The existing application does not have any forms used.
  I want to set the input field to invalid based on a condition in the component that if the user does not enter anything in the input, the bottom outline appears red when the condition is true to show the error on button click.</p>
  <pre><code>  &lt;mat-form-field&gt;
      &lt;input matInput [(ngModel)] = &quot;isavailable&quot;&gt;
    &lt;/mat-form-field&gt;
  </code></pre>
  <p>The existing application does not have any forms used, hence unable to to use something as below
  formData.form.controls['email'].setErrors({'incorrect': true}); //cannot use this as the app do not have any forms like formData.</p>