简体   繁体   English

AngularJS + jQuery +移动angular ui + phonegap =失败

[英]AngularJS + jQuery + mobile angular ui + phonegap = fail

I'm trying to build my first mobile app . 我正在尝试构建我的第一个移动应用程序 What I usying: AngularJS, Mobile Angular UI, jQuery and PhoneGap . 我正在使用什么: AngularJS,Mobile Angular UI,jQuery和PhoneGap

My code: 我的代码:

<!doctype html>
<html>
<head>
    <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.15/angular.min.js"></script>
    <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.15/angular-route.min.js"></script>
    <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.15/angular-touch.min.js"></script>
    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
    <link rel="stylesheet" href="/mobile-angular-ui/dist/css/mobile-angular-ui-base.min.css" />
    <link rel="stylesheet" href="/mobile-angular-ui/dist/css/mobile-angular-ui-desktop.min.css" />
    <link rel="stylesheet" href="/css/demo.css" />
    <script src="/mobile-angular-ui/dist/js/mobile-angular-ui.min.js"></script>
</head>
<body ng-app="MyApp" ng-controller="MainController">

   HERE HTML CODE

<script>

   HERE ALL LOGIC

</script>
</body>
</html>

In all browsers all works fine, but when I getting apk file from PhoneGap and running it on my Nexus 4 ( Android ) I seeing white screen :*( 在所有浏览器中都可以正常工作,但是当我从PhoneGap获取apk文件并在Nexus 4( Android )上运行该文件时 ,我看到了白屏 :*(

you need to add the below line at the start of the the head tag 您需要在head标签的开头添加以下行

<script type="text/javascript" src="cordova.js"></script>

Also make sure you check the deviceready event to make any native device API calls. 还要确保您检查deviceready事件以进行任何本机设备API调用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM