I'd like to use angular's template engine to generate some xml documents.
Is it possible to use the template engine "standalone" to generate a string? Something along these lines:
- <script type="text/ng-template" id="/xml.html">
- <?xml version="1.0" encoding="UTF-8"?>
- <node1 ..>
- <Row ng-repeat="data in items">
- <Item>{{data}}</Item>
- </Row>
- </node1>
- </script>
Then, I would just need to invoke it within a service:
...['$some_unknown_dep', function(templateEngine)(){
var str = templateEngine.render('/xml.html', {items: [1,2,3]});
}]);
Yeah, POSTing JSON would be easier, but it's not my service :\
Thanks!