Angular 6 remove html tags from string. import { Component } from '@angular/core'; declare var striptags: any; @Component ( { selector: 'my-app', I’d suggest a regex to remove the html elements and html entities. Angular automatically escapes data if you use ng-bind or the {{ curly brace syntax }}. Solution The text looks to be double-escaped, kinda - first turn all the & s into & s, so that the HTML entities can be properly recognized. When you need to set HTML attributes that do not have corresponding DOM properties, such as ARIA attributes or SVG attributes, you can bind attributes to elements in your template with the attr. This means it outputs the literal characters instead of interpreting them as HTML. prefix. text () will give you the plain text version of the HTML markup. . Jul 15, 2025 ยท Since every HTML tags are enclosed in angular brackets (<>). The problem with using innerHTML is that the HTML gets parsed and rendered, so things like <p> tags will add margins and ruin the list's alignment.