I take comments from users for an image which is displayed in my website by using a WYSIWYG editor (rich text editor). The ng-modal
of this text editor returns the texts with HTML tags as well. For example:
<u><b><i>test1</i></b></u>
Currently, I store them in the database as varchar
. But when I display these HTML contents on the front-end again after fetching them from the database, it displays as plain text instead of as HTML elements.
Is there any other datatype which can store HTML elements as HTML objects in the database other than varchar
?
How can I output an HTML object from a string type angular (JavaScript) variable which contains HTML elements?