Sanitization

Last updated

What is Sanitization?

Sanitization is the inspection of an untrusted value, turning it into a value that's safe to insert into the DOM. In many cases, sanitization doesn't change a value at all. Sanitization depends on context: A value that's harmless in CSS is potentially dangerous in a URL.

Angular sanitizes untrusted values for HTML and URLs. Sanitizing resource URLs isn't possible because they contain arbitrary code. In development mode, Angular prints a console warning when it has to change a value during sanitization.

Free resources to learn Sanitization

More in stage 18: Developer Tools

Sanitization: common questions

Can I learn Sanitization in Hindi?

This lesson is written in English. Once you sign in, open it in the interactive course and ask the AI tutor to explain Sanitization in Hindi or Hinglish. The tutor answers from this lesson’s own text, so it stays on the syllabus, and it runs on your own Google, OpenAI or Anthropic key.

Is this Sanitization tutorial for beginners?

It is lesson 109 of 158 in the free Angular roadmap, in stage 18, Developer Tools. If you are new to Angular, start from stage 1 and come back here in order; if you already know the earlier stages, this lesson stands on its own.

Still confused? Ask me