I'm using angularjs to fetch json data from a rest webservice.
Problem: most text elements come preformated containing html tags like <p>, <br>, <ul> etc. As an indicator for these tags, the texts are wrapped inside a CDATA tag as follows:
json:
{
"offerName": "<![CDATA[<b>Testoffer 1</b>]]>"
}
angularjs:
$http.get(url).success(function(data) {
$scope.data = data;
});
html:
<h1>{{data.offerName}}</h1>
Now, how could I let the clientside remove any CDATA tags before they are shown?
.replace('<![CDATA[', '').replace(']]', '');or something CDDATA/angular/json specific?