MoLow / ng-node-compile

Compile html templates the angular way, in node js
14 stars 7 forks source link

Is there a way to support ng-include? #3

Open butaixianran opened 9 years ago

butaixianran commented 9 years ago

Is there a way to support ng-include?

My page is a tree structure, which means there are some ng-include and embeded ng-include (ng-include in ng-include's html template)

This is what I tried:

<div>
    <div ng-include="card.html"></div>
</div>
<script type="text/ng-template" id=" 'card.html' ">
    <div>This is a card</div>
</script>

in js:

let result = ngEnviorment.$compile('<div><div ng-include="card.html"></div></div><script type="text/ng-template" id="card.html"><div>This is a card</div></script>')({name:"A Name"});

it doesn't work for now. Is there a way to support ng-include?

Thanks