Ashish Gehlot
Ashish Gehlot

Reputation: 579

Use custom pipe in multiple modules without sharedModule

Is it possible to use CustomPipe in lazy modules without using common or shared modules. I don't want to write pipe for every module.

Below is my CustomPipe.ts

    import { Pipe, PipeTransform } from '@angular/core';
import { DomSanitizer } from '@angular/platform-browser';

@Pipe({
  name: 'bypassHtml'
})

export class BypassHtmlPipe implements PipeTransform {

  constructor(private sanitizer: DomSanitizer) { }

  transform(value: any): any {
    return this.sanitizer.bypassSecurityTrustHtml(value);
  }

}

Thank you in advance

Upvotes: 0

Views: 309

Answers (0)

Related Questions