title: Does anyone know how to use titlecase in component.ts file instead in html file?
body: <p>I tried the following code but it's not working. </p>
  
  <pre><code>import { Component } from '@angular/core';
  import { TitleCasePipe } from '@angular/common';
  @Component({
    selector: 'my-app',
    templateUrl: './app.component.html',
    styleUrls: [ './app.component.css' ]
  })
  export class AppComponent  {
    title = 'Working with Pipe';
    testValue = this.titleCasePipe.transform('firstletter should be upper case.');
  
  
    constructor(
      public titleCasePipe: TitleCasePipe
    ){}
  
  }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/X3kC2.png" rel="nofollow noreferrer">enter image description here</a></p>