1.1.10 • Published 8 years ago
decode-html-entities v1.1.10
decode-html-entities
decode-html-entities converts special characters like & 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!