angularjs - 如何使用angular js在Cordova中插入#reference

标签 angularjs cordova angularjs-scope phonegap-build

我有一个 angular js 应用程序,我试图将其包装为移动的 Cordova 应用程序。

该网址在浏览器上运行良好,但在移动浏览器上的重定向存在一些问题。当我尝试打印 url 的绝对位置时,我被重定向到类似

的 url

file:///Users/mac/Library/Developer/CoreSimulator/Devices/69F93249-284F-4F04-82CA-14B111CCA50F/data/Containers/Bundle/Application/B21EB426-7066-4425-82F0-6F73736D880C/ClientManagement.app/www/index.html#/dashboard

调用index页面时,url中少了一个/

如何在加载 index.html 后附加 /

编辑:首次加载应用程序时,它指示加载了以下文件:

file:///Users/mac/Library/Developer/CoreSimulator/Devices/69F93249-284F-4F04-82CA-14B111CCA50F/data/Containers/Bundle/Application/B21EB426-7066-4425-82F0-6F73736D880C/ClientManagement.app/www/index.html#/

但是我打算加载的只是

file:///Users/mac/Library/Developer/CoreSimulator/Devices/69F93249-284F-4F04-82CA-14B111CCA50F/data/Containers/Bundle/Application/B21EB426-7066-4425-82F0-6F73736D880C/ClientManagement.app/www/index.html

我在config.xml中调用

<content src="index.html" />

最佳答案

关于angularjs - 如何使用angular js在Cordova中插入#reference,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34352650/

相关文章:

javascript - 当我打开同一页面时,应该在下次选择已经选择的项目

javascript - window.onbeforeunload 在 Android Chrome 上不会触发 [alt.解决方案?]

android - 即使删除了应用程序,Cordova 应用程序中的 Web 存储也会被保留

javascript - ng-init 在选择选项中覆盖 ng-model (添加了 plunker)

javascript - AngularJS ngRepeat 元素删除

javascript - 使用 angular.js 用最后选择的值填充隐藏字段

android - 尝试在 mac os x 上使用 phonegap-2.8.1 创建 Android 项目时发生意外错误

cordova - Visual Studio 2015 Cordova Tools - 启动 Ripple 时出现错误 "scriptedsandbox64.exe has stopped working"

javascript - 按下空格键或 Enter 键后,Angular 模型不会更新

AngularJS 的 $http.post() 每次发送两个 AJAX 请求,一个没有数据,一个有