我有一些jsons數據如下,當我試圖用ng-include和ng-template遞歸地打印它們(如下所示)時,ng-include的內部html代碼不會呈現它是空白的。 和其他問題是,在打印ng-include時,它只是打印1級遞歸,並且不會繼續打印。HTML不呈現在ng模板角
有什麼不對?
JSON數據:
[{"name":"default","path":">var>www>rapa-v2>themes>","subdir":[{"name":"css","path":">var>www>rapa-v2>themes>>default","subdir":[{"name":"images","path":">var>www>rapa-v2>themes>>default>css","subdir":[]},{"name":"style.css","path":">var>www>rapa-v2>themes>>default>css"}]},{"name":"index.blade.php","path":">var>www>rapa-v2>themes>>default"},{"name":"information.json","path":">var>www>rapa-v2>themes>>default"},{"name":"screen.jpg","path":">var>www>rapa-v2>themes>>default"}]}]
HTML代碼:
<div class="theme-files-list ltr" ng-init="loadDir('{{ $theme }}')">
<script type="text/ng-template" id="directoryTree">
<div class="tree-item">
<i class="fa fa-file-text-o maroon"></i>
<a href="<% '/admin/setting/template/edit/{{ $theme }}/'+item.name %>">
<% item.name %>
</a>
</div>
<ul ng-if="item.subdir">
<li ng-repeat="item in item.subdir" ng-include="'directoryTree'"></li>
</ul>
</script>
<ul class="noselect">
<li>
<div class="tree-item bg-aqua">
<i class="fa fa-paint-brush blue"></i>
{{ ucfirst($theme) }}
</div>
<ul>
<li ng-repeat="item in themeDir" ng-include="'directoryTree'"></li>
</ul>
</li>
</ul>
</div>
重要:我用laravel和用於刀片系統的打印,我已經取代角度打印符號{{}}與<%>
可以使用Laravel'@ {{}}'不要求你改變角度'{{}}'語法 – PaladiN