【发布时间】:2017-11-15 00:39:22
【问题描述】:
我刚开始使用 phonegap 学习 angularJS,我有一个简单的 HTML 代码和几行 angularjs 代码。在浏览器中一切正常,但当我尝试在我的 Android 手机上运行它时,只有 HTML 代码在 phonegap 中工作。为什么?
<!DOCTYPE html>
<html>
<script src="C:\Users\Ghaith Haddad\Desktop\learning\learn\angular-1.5.8"></script>
<script src="C:\Users\Ghaith Haddad\Desktop\learning\learn\www\me.js"></script>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
<title>AngularJS Tutorial</title>
</head>
<body>
<script type="text/javascript" src="cordova.js"></script>
<div ng-app="app3" ng-controller="ctrl1">
<span>Values:</span>
<input type="text" ng-model="first" />
<input type="text" ng-model="second" />
<h1>hello there buddy</h1>
<button ng-click="update()">Sum</button>
<br><br>
{{calculation}}
</div>
<script>
var app = angular.module('app3', []);
app.controller('ctrl1', function($scope) {
$scope.first = 1;
$scope.second = 2;
$scope.update = function(){
$scope.calculation = (+$scope.first + +$scope.second);
};
});
<!-- Load the AngularJS library -->
</script>
<!-- Load the JS Module -->
</body>
</html>
这里是JS代码:
var app = angular.module('app3', []);
app.controller('ctrl1', function($scope) {
$scope.first = 1;
$scope.second = 2;
$scope.update = function(){
$scope.calculation = (+$scope.first + +$scope.second);
};
});
【问题讨论】:
-
由于某种原因它没有显示前几行,它也有这个:
-
我认为您的手机无法访问您的工作站硬盘 ->
C:\Users\Ghaith Haddad\Desktop\learning\learn\www\me.js&C:\Users\Ghaith Haddad\Desktop\learning\learn\angular-1.5.8;-) -
我明白了,你知道我该如何解决这个问题吗?谢谢
标签: javascript html angularjs phonegap-build phonegap