decode-html-entities
TypeScript icon, indicating that this package has built-in type declarations

1.1.10 • Public • Published

decode-html-entities

decode-html-entities converts special characters like &amp into &.

Install in your project

npm install decode-html-entities --save

Example

input: '1 & 2' output: '1 & 2'

How to use?

import module
@NgModule({
    declarations:[DecodeHtmlEntitiesModule],    
    exports:[DecodeHtmlEntitiesModule]    
})
 
 <p>{{ text | decodeHtmlEntities }}</p>

How?

transform(value: any, args: any[]): any {
        if (!value) return;
        let txt = document.createElement("textarea");
        txt.innerHTML = value;
        return txt.value;
    }

License

MIT Free Software, Yeah!

Readme

Keywords

Package Sidebar

Install

npm i decode-html-entities

Weekly Downloads

79

Version

1.1.10

License

none

Last publish

Collaborators

  • hebert