I'm using ckeditor to get what user has inputed in the textarea , but when I want to show/render that field in my page it just shows the html tags not the rendered one ! It's odd cause even tags aren't escaped and everything looks like a pure html syntax which is just not rendered ! what is stored in mongodb is this :
"longDesc" : "<p style=\"text-align: left;\">We need creation of <strong>7 animated banners</strong>.</p>\n\n<p style=\"text-align: left;\">We need to remake to dynamic form. We provide you open source data and technical specifications.</p>\n"
and am using angularjs double brace in view to show this expression .
{{job.longDesc}}
and the output exactly is :
<p style=\"text-align: left;\">We need creation of <strong>7 animated banners</strong>.</p>\n\n<p style=\"text-align: left;\">We need to remake to dynamic form. We provide you open source data and technical specifications.</p>\n
Take a look at ngBindHtml. You just need to:
$scope.myHTML = '<p>test</p>';
....
<div ng-controller="ExampleController">
<p ng-bind-html="myHTML"></p>
</div>
You will need to include the ngSanitize in your app dependency to make the ng-bind-html work. Here is an Plunker example:
http://plnkr.co/edit/RRNyiwQAaHQfNqtHslCD?p=preview
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With