0.0.2 • Published 5 years ago
ngx-sanitizer v0.0.2
Ngx-Sanitizer
Installation
npm i ngx-sanitizer- Import
NgxSanitizerModuleinto your module(s).
About
This library provides a set of simple yet useful pipes:
SafeUrlPipeSafeHtmlPipeSafeStylePipeSafeScriptPipeSafeResourceUrlPipe
that can be used to say Angular we trust the data we provide, e.g.:
@Component({
template: `<p [innerHtml]="someUntrustedHtml | safeHtml"></p>`,
})
export class SomeComponent {
someUntrustedHtml = '<strong onclick="alert(\'and clickable\');">I am Strong!</strong>';
}