I am trying to create a Rich Text Editor with contenteditable
div, using Angular and TypeScript.
I have managed to save image into database(pouchDB) in Base-64-encoded string.
like this in plain text:
<img src="data:image/png;base64,iVBORw0KGgoUlEQVR4Ae2diXdV1RWH+Q9bba1TLa11WO3SLhRBpIBo=">
But when i read it from database and try to render on page as image, it is also displaying as above plain text.
img
tag data could be mixed with other Text content, what is the
general principal to separate them from each other?You need to render it as innerHTML instead of string?
<div [innerHTML]="content"></div>
not
<div>{{ content }}</div>