【发布时间】:2015-12-10 09:43:24
【问题描述】:
当我从主机(使用 chrome)运行我的项目时,它可以使用所有导航而没有任何错误。
但是当我在 GenyMotion 模拟器上运行它时,它就不行了。除非我将模板作为字符串而不是 URL:
var myApp= angular.module('MyApp', [
'ngRoute',
'ngAnimate',
'ngMaterial'
]);
myApp.config(function ($routeProvider) {
$routeProvider
.when('/test', { /////////////////////////THIS IS WORKING
template : '<span> AHEY </span>',
controller : 'testController'
})
.when('/LoginPage', {/////////////////////////THIS IS NOT WORKING
templateUrl : 'LoginPage.html',
controller : 'loginController'
})
});
我的html:
<!DOCTYPE html>
<html ng-app="MyApp">
<head>
...
</head>
<title>My App</title>
<body ng-controller="mainController">
<div id="header" layout="row" > </div>
<div ng-view></div>
<script> .... </script>
</body>
</html>
【问题讨论】:
-
你能在命令提示符下检查 adb logcat -c 吗?
-
如果我写
adb logcat -c,我什么都不带。但我有一个正在运行的 logcat,上面写着:no content-security-policy meta tag found. please add one when using the whitelist plugin。不知道是不是和这个问题有关? -
尝试android平台19并进行构建和检查
标签: javascript android angularjs cordova ngroute