title: Pipe could not be found: Angular 5 custom pipe
body: <p>I have read <a href="https://stackoverflow.com/questions/39007130/the-pipe-could-not-be-found-angular2-custom-pipe">this post</a> and <a href="https://medium.com/@swarnakishore/angular-safe-pipe-implementation-to-bypass-domsanitizer-stripping-out-content-c1bf0f1cc36b" rel="nofollow noreferrer">this article</a>. I believe I have done everything suggested: added the pipe to a module which is shared.</p>
  
  <p>However, no matter what I do I cannot get my template to find the pipe I created. My app already has a Shared Module which the other modules import, so I create the pipe and added it to the shared module:</p>
  
  <p>I created it with <code>ng g pipe /shared/pipes/safe --flat --module shared --spec=false</code> </p>
  
  <p>In SharedModule, I also added it to <code>declarations</code> and <code>providers</code>.</p>
  
  <p>Everything runs, but it I try to use the pipe, as in:</p>
  
  <p><code>&lt;iframe width="600" height="360" [src]="video.acf.youtube_url | safe: 'url'" frameborder="0" allowfullscreen&gt;&lt;/iframe&gt;</code></p>
  
  <p>I just get an error</p>
  
  <p><code>Error: Uncaught (in promise): Error: Template parse errors: The pipe 'safe' could not be found</code></p>
  
  <p>The pipe itself is </p>
  
  <pre><code>import { Pipe, PipeTransform } from '@angular/core';
  import { DomSanitizer, SafeHtml, SafeStyle, SafeScript, SafeUrl, SafeResourceUrl } from '@angular/platform-browser';
  
  @Pipe({
    name: 'safe'
  })
  export class SafePipe implements PipeTransform {
  
    constructor(protected sanitizer: DomSanitizer) { }
  
    public transform(value: any, type: string): SafeHtml | SafeStyle | SafeScript | SafeUrl | SafeResourceUrl {
      switch (type) {
        case 'html': return this.sanitizer.bypassSecurityTrustHtml(value);
        case 'style': return this.sanitizer.bypassSecurityTrustStyle(value);
        case 'script': return this.sanitizer.bypassSecurityTrustScript(value);
        case 'url': return this.sanitizer.bypassSecurityTrustUrl(value);
        case 'resourceUrl': return this.sanitizer.bypassSecurityTrustResourceUrl(value);
        default: throw new Error(`Invalid safe type specified: ${type}`);
      }
    }
  }
  </code></pre>