title: How to dynamically inject or load a pipe in Angular 8?
body: <p>I have the following custom pipe in my Angular 8 app:</p>
  
  <pre><code>import { Pipe, PipeTransform } from '@angular/core';
  import { MyService} from '../_services/my.service';
  
  @Pipe({
      name: 'myPipe'
  })
  export class MyPipe implements PipeTransform {
      constructor(private myService: MyService) {}
  
      transform(value: string): any {
          return this.myService.loadForID(value);
      }
  }
  </code></pre>
  
  <p>I am trying to transform a value dynamically in a component code, by having the string name only: <strong>'myPipe'</strong> but i cannot find anyway to inject/load a pipe dynamically for a string. <a href="https://stackoverflow.com/questions/37482460/getting-instance-of-service-without-constructor-injection">an online post that i found</a> suggests the following code, but even this seem to require a type (MyService) and not a string</p>
  
  <pre><code>constructor(private injector:Injector) {
    injector.get(MyService);
  }
  </code></pre>
  
  <p>is there a way to achieve this in Angular? </p>