ios - Cordova ios angularjs没有找到模板
问题描述
当我尝试使用我在 xcode 中构建的 cordova ios 应用程序时遇到问题。它开始了,然后我收到一个错误,即 angularjs 无法加载模板。相同的应用程序在浏览器和安卓上运行良好。
我构建它的步骤
科尔多瓦在终端中构建 ios。
然后我打开 .xcworkspace 文件以在 xcode 中打开它。然后我将它构建到连接的 iphone。我得到一个启动画面,我看到我的 init promisechain 运行但随后它停止了。
templateUrl: 'js/modules/header/html/header.html',
文件结构是 www -> js -> 模块 -> header -> html -> header.html
我得到的错误是:
020-05-13 15:59:05.496068+0200 [3439:2658415] 错误:[$templateRequest:tpload ] http://errors.angularjs.org/1.7.8/$templateRequest/tpload?p0=.%2Fjs% 2Fmodules%2Fheader%2Fhtml%2Fheader.html&p1=-1&p2= file:///var/containers/Bundle/Application//.app/www/js/node_modules/angular/angular.min.js:7
任何人都知道如何解决它?
解决方案
So the problem was CORS.
After installing the plugin https://github.com/oracle/cordova-plugin-wkwebview-file-xhr it works as intended. I think they will solve it in cordova-plugin-wkwebview but for now the xhr plugin is necessary.
推荐阅读
- sql - ORA-00928: 缺少 SELECT 关键字,SQL 语句未传递给 DBMS,SAS 将进行处理
- c++ - 合并 K 排序的链表中的循环
- mysql - 根据同一行中的另一个 DISTINCT 列获取 DISTINCT 列
- google-sheets - 修剪 Google 工作表中的文本
- python - 为什么我的应用程序在启动后立即关闭
- github - Google Colab Notebook 保存到 github 错误
- css - 如何在 React Modal 中添加填充?
- html - 我正在尝试彼此对齐
- html - 需要帮助以准确了解 HTML 代码的放置位置?
- bluetooth - 我想用树莓派3b机型配置蓝牙mesh网络和6Lowpan进行mqtt通信