What is angular sanitize?
Overview. Sanitizes an html string by stripping all potentially dangerous tokens. The input is sanitized by parsing the HTML into tokens. All safe tokens (from a trusted URI list) are then serialized back to a properly escaped HTML string. This means that no unsafe input can make it into the returned string.
Why use sanitizer in Angular?
Sanitizer is used by the views to sanitize potentially dangerous values.
Does angular sanitize HTML?
No need to sanitize manually with innerHTML, Angular automatically sanitizes it for you when there's an unsafe value. Check out Angular Documentation for more details. Angular recognizes the value as unsafe and automatically sanitizes it, which removes the tag but keeps safe content such as the element.