example...


paragraph...

How to remove HTML tag from JSON

I have a JSON file like

[{"description":"<p> example...</p> </br> <p>paragraph... </p> <div id="test" class="test2" style="left: -10000px; top: 10px; position:absolute;"> <p>paragraph... </p> "}]

      

So how can I remove HTML tags like <p> </p>

</br>

for display in ionic structure

+3


source to share


1 answer


If you can't use a parser oriented HTML solution to filter tags, here's a simple regex.

var noHTML =  OriginalString.replace(/(<([^>]+)>)/ig,"");

      



Here is a working plunker

+1


source







All Articles