i'm using an API to get my posts of my blog. But i'm getting the content that's a HTML code but i'm trying to see it as i saw in the blog but aren't working. I had tried it using this filter and functions:
.filter('unsafe', function($sce) {
return function(val) {
return $sce.trustAsHtml(val);
};
})
And in controller:
function htmlDecode(input){
var e = document.createElement('div');
e.innerHTML = input;
return e.childNodes[0].nodeValue;
}
In the template:
<div ng-bind-html="post.conteudo | unsafe"></div>
But this codes aren't making this work properly. As result of this, i get a raw/plain text like this:
What can i do?