I want to compile an AngularJS template to plain text. I.e. I want to get what you would get by reading the inner HTML of a template rendered in the DOM on the page. But without actually rendering the template to the page.
I have tried using $compile like this
$compile(template)($scope).html()
But it does not seem to work as expected as demonstrated in this jsFiddle. The result both in the jsFiddle and in my project is nothing but a comment inserted by Angular.
What is the proper way to compile an Angular template and getting the result back as an HTML string?
In case anyone are curious why I need to do this: The rendered HTML will be sent to the backend which converts it to a pdf-file that is sent back again.