ios - AngularJS ng-include 模板未在 Phonegap 应用程序中加载
<p><p>我正在构建一个使用 AngularJS 的 iOS Phonegap 应用程序。</p>
<p>我在 <code>ng-switch</code> 中有一些 <code>ng-includes</code>,可以根据项目的类别更改某些列表项的样式。</p>
<pre><code> <div
ng-repeat="i indata"
ng-include="src='partials/card.html'""
>
</div>
</code></pre>
<p>在 <em>partials/card.html</em> 文件中,是开关:</p>
<pre><code><div
ng-switch on="i.group"
>
<div ng-switch-when="Music">
<div ng-include="src='partials/card_details/'+i.category+'.html'"
></div>
</div>
<div ng-switch-when="Film"
ng-include="src='partials/card_details/buy.html'"></div>
<!-- default, load group -->
<div ng-switch-default ng-include="src='partials/card_details/'+i.group+'.html'"
></div>
</code></pre>
<p></p>
<p>这一切都在我的桌面浏览器上的 Chrome 中完美运行,但是当我运行我的 Phonegap 应用程序时,使用与 Chrome 中运行的页面相同的符号链接(symbolic link) www 文件夹,所有内容都会加载<em>除了</em>里面的部分switch 语句。</p>
<p>我在 Xcode 控制台中没有收到任何错误,我尝试将“/”添加到 <em>src</em> 的开头,因为我在 Phonegap 中的根路径存在问题,但我不明白的是为什么 <em>partials/card.html</em> 加载而 <em>not</em> *partials/card_details*</p>
<p>有什么想法吗?</p></p>
<br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
<p><p>这是不是因为下面一行中的 ng-include 末尾有双引号:</p>
<pre><code> <div
ng-repeat="i indata"
ng-include="src='partials/card.html'""
>
</div>
</code></pre></p>
<p style="font-size: 20px;">关于ios - AngularJS ng-include 模板未在 Phonegap 应用程序中加载,我们在Stack Overflow上找到一个类似的问题:
<a href="https://stackoverflow.com/questions/15168908/" rel="noreferrer noopener nofollow" style="color: red;">
https://stackoverflow.com/questions/15168908/
</a>
</p>
页:
[1]