I'm currently using $http.get to retrieve the data from the backend. The data received is actually in HTML format; however, it comes back escaped with \t\n and all the white spaces. If I were to perform the same $.get request using jQuery, the data that comes back comes unescaped. Anyway how I can use get the raw unescaped HTML? I've tried $sce.trustAsHtml with no avail.
2 Answers
I don't know how you are getting the response, because you have not shared any code.
How are you getting the data?
I use $http to get raw HTML templates without any issue:
$http.get('url').then(function(response) {
var raw_html = response.data;
});
3 Comments
john smith
for some odd reason, i get escaped HTML as a response regardless if I use $sce or not.
J. Bruni
Maybe it is coming escaped from the server... can you inspect what is coming from the server? (Using Chrome developer tools, Firebug, or other tool...)
J. Bruni
@AniketSinha: None, actually. I am used to code in PHP. Just this. I will remove the
$.
$http.get?