ngx-sanitizer
TypeScript icon, indicating that this package has built-in type declarations

0.0.2 • Public • Published

Ngx-Sanitizer

Installation

  1. npm i ngx-sanitizer
  2. Import NgxSanitizerModule into your module(s).

About

This library provides a set of simple yet useful pipes:

  • SafeUrlPipe
  • SafeHtmlPipe
  • SafeStylePipe
  • SafeScriptPipe
  • SafeResourceUrlPipe

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>';
}
NOTE: Please, make sure you made yourself familiar with Angular Security Guide and you know which resources can be trusted.

Readme

Keywords

none

Package Sidebar

Install

npm i ngx-sanitizer

Weekly Downloads

19

Version

0.0.2

License

none

Unpacked Size

102 kB

Total Files

27

Last publish

Collaborators

  • danielkucal