S
S
SerzN12015-10-29 12:46:18
Angular
SerzN1, 2015-10-29 12:46:18

How to compile angular template to pure html?

There is an array of data items.
Is there a template

<script type="text/ng-template">
<ul>
<li ng-repeat="item in items">{{item.name}}</li>
</ul>
</script>

How can you compile the template to pure HTML from this data and output the HTML to the textarea?
The question is getting clean code, since the compiled angular template contains a bunch of garbage like ng-repeat artifacts, hidden comments and other things. We need clean code. Thank you.
UP: found this, have to do everything manually
stackoverflow.com/questions/19371540/how-to-clean-...
stackoverflow.com/questions/19402026/is-it-possibl...

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Andrew, 2015-10-29
@R0dger

Take a foreach and write everything into a variable, and it's already in the textarea

L
lega, 2015-10-29
@lega

In Angular there is probably no solution for this, you can later run through the resulting DOM piece and cut out all ng- and comments.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question