I'm in a bit of a jam, I am getting data from an endpoint with angular, JSON, and sometimes that data could be HTML code, I read about it and I found out that if I want to parse that info as HTML, without ""
, I have to use JSON.parse()
.
The problem is that now the code is escaped and throws an error before calling it in my template. http://screencast.com/t/zledZ6rBod
I can see why this is happening, but how can I output interpretable HTML markup in my template?
$sce.parseAs($sce.HTML, myJSONResponse.HTMLcontent)
Another error. screencast.com/t/fdoiIEveMJ$scope.projContent = $sce.trustAsHtml(data[i].posts[0].content);