Search⌘ K
AI Features

Inserting Raw HTML

Explore how to insert raw HTML into Angular templates using the innerHTML property binding. Understand how Angular balances flexibility with security by purifying HTML content to prevent cross-site scripting attacks, allowing dynamic HTML rendering without compromising safety.

We'll cover the following...

We saw how Angular takes care of preventing XSS attacks in the previous lesson. It’s something we generally don’t have to worry about. However, there are some cases where we’ll want to insert HTML into the document.

We can do so by binding the ...