When to use $ sanitize and $ sce? What are the differences between them?

I am trying to understand what is the difference between properties.

Please help with practical examples. When to use them?

No such questions were found on this forum. Help me please.

+4
source share
1 answer

$sceis a service that actually chooses whether a string is safe to use and whether to disinfect it. If it is HTML, it runs through $sanitizeif it is available. You probably will never need to use it $sanitize- since all lines are escaped by default, you simply selectively trust HTML using the service $sce.

Here you can learn more about $ sce.

+3
source

All Articles