I have a simple library with a component and I need to use DomSanitizer for html strings. I am consuming this library inside my Application project.
I already know that I should import Domsanitizer and inject it in the constructor as many have already explained: Correct way Provide DomSanitizer to Component with Angular 2 RC6
EDIT:
As you can also check here:
LibraryComponent.ts
import {DomSanitizer, SafeHtml} from '@angular/platform-browser';
export class SqvLibComponent implements OnInit {
constructor( private sanitizer: DomSanitizer ) {
}
sequenceRegion: SafeHtml;
this.sequenceRegion = this.sanitizer.bypassSecurityTrustHtml(myStringtoSanitize);
}
But I get an error stating:
"No provider for Domsanitizer!"
Does someone understand why? Thank you!