I want to display data from database (using PHPMYADMIN). The data which I want to display stored using ng2-ckeditor (Angular 6). So when it gives result it also shows the html tags, which I don’t want. How do I get my result without displaying HTML tags?
This is for displaying in html page
(and newsArray
is type Object)
which is displaying data but with html tags
<div *ngFor="let item of newsArray">
<div class="panel-body">
{{item.details}}
</div>
</div>
result given by this is:
<p>hello</p>
but expected result:
hello
2
Answers
You can replace your result like this:
This will replace all your html tags and keep only the blank text.
See my stackblitz demo
you can use [innerHtml] property on the div