Angular directives: ng-bind-html - Forum

Forum Navigation
You need to log in to create posts and topics.

Angular directives: ng-bind-html

By default if you put HTML code into a variable value it will be displayed as plain text. This can be avoided using ng-bind-html AngularJS directive. Note that, for security reasons, any JavaScript or CSS tag within the HTML will not be executed.
Please take a look at the attached sample.

<div ng-bind-html="[htmlcontent]"></div>

Let me know if you have any questions.

Uploaded files:
  • You need to login to have access to uploads.
Vadim, farhad2008 and 2 other users have reacted to this post.
Vadimfarhad2008asmatnoyzen
Open chat
1
Do you need more info?
Hi, do you have any doubt?