Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/112.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angular$templateCache和$stateProvider修复本机ios phonegap/cordova_Ios_Angularjs_Cordova_Ionic Framework_Angular Templatecache - Fatal编程技术网

Angular$templateCache和$stateProvider修复本机ios phonegap/cordova

Angular$templateCache和$stateProvider修复本机ios phonegap/cordova,ios,angularjs,cordova,ionic-framework,angular-templatecache,Ios,Angularjs,Cordova,Ionic Framework,Angular Templatecache,Angular$templateCache、$stateProvider和ng include在web浏览器中运行良好,但在使用phonegap/cordova的本机ios上,它不会加载模板或进入状态 我看了一下清单: 删除 确保路径是相对的“template.html” vs“/template.html” 确保HTML5模式为false 在开始之前加载templates.js 确保依赖注入已到位 下面是一些在浏览器中工作但在本机ios上不工作的示例 $stateProvider.stat

Angular$templateCache、$stateProvider和ng include在web浏览器中运行良好,但在使用phonegap/cordova的本机ios上,它不会加载模板或进入状态

我看了一下清单:

  • 删除
  • 确保路径是相对的“template.html” vs“/template.html”
  • 确保HTML5模式为false
  • 在开始之前加载templates.js
  • 确保依赖注入已到位
下面是一些在浏览器中工作但在本机ios上不工作的示例

$stateProvider.state('start', {
    url: '',
    templateUrl: 'templates/start/start.html'
});



有什么想法吗?我找不到有效的解决方案。

我相信其他人会遇到这个问题。解决方案与移动构建根目录下的config.xml文件有关。这就是我的工作

<allow-navigation href="file://*/*"/>
<allow-navigation href="*"/>
<allow-intent href="file://*/*"/>
<allow-intent href="*"/>
<access origin="file://*/*"/>
<access origin="*"/>

我相信其他人会遇到这个问题。解决方案与移动构建根目录下的config.xml文件有关。这就是我的工作

<allow-navigation href="file://*/*"/>
<allow-navigation href="*"/>
<allow-intent href="file://*/*"/>
<allow-intent href="*"/>
<access origin="file://*/*"/>
<access origin="*"/>


它应该可以正常工作,您的路径或项目设置可能有问题。也许你的项目文件夹结构截图会有帮助,谢谢,@FranePoljak-这是一个配置问题。我在下面添加了我的解决方案。对于iOS,您可以在Safari->Developer->select device/simulator(应用程序运行的位置)->Index.html中检查错误。希望这能帮助您在下次正常工作时更轻松地调试错误,您的路径或项目设置可能有问题。也许你的项目文件夹结构截图会有帮助,谢谢,@FranePoljak-这是一个配置问题。我在下面添加了我的解决方案。对于iOS,你可以在Safari->Developer->select device/simulator(你的应用程序运行的地方)->Index.html中检查错误,希望这能帮助你下次更轻松地调试错误
<allow-navigation href="file://*/*"/>
<allow-navigation href="*"/>
<allow-intent href="file://*/*"/>
<allow-intent href="*"/>
<access origin="file://*/*"/>
<access origin="*"/>