title: How to make custom pipe to work in formcontrolname in reactive form using angular8
body: <p>Hi i am using reactive forms in my angular application, and i have written custom pipe to convert text into sentence case while typing, and while binding also it should be converted to sentence case. But i am failing to convert text in sentence case using reactive forms. Can any one help me to convert into sentence case using pipe in reactive forms, or can this pipe be created as directive to make it work in reactive forms.</p>
  <p>HTML:</p>
  <pre><code>&lt;form [formGroup]=&quot;myForm&quot;&gt;
      &lt;input formControlName=&quot;myNumber| titleCase&quot; /&gt;
  &lt;/form&gt;
  </code></pre>
  <p>TS:</p>
  <pre><code> this.myForm = this.fb.group({
        myNumber: [&quot;hello hai how are you&quot;]
      });
  </code></pre>
  <p>Pipe.ts:</p>
  <pre><code>import { Pipe, PipeTransform } from &quot;@angular/core&quot;;
  
  @Pipe({ name: &quot;titleCase&quot; })
  export class TitleCasePipe implements PipeTransform {
    public transform(input: string): string {
      console.log(input);
      if (!input) {
        return &quot;&quot;;
      } else {
        return input.replace(
          /\b((?!=|\,|\.).)+(.)\b/g,
          first =&gt; first.substr(0, 1).toUpperCase() + first.substr(1)
        );
      }
    }
  }
  </code></pre>
  <p><a href="https://stackblitz.com/edit/angular-2run8u?file=src%2Fapp%2Fapp.component.ts" rel="nofollow noreferrer">DEMO</a></p>