1

I am developing an app using angularjs and phonegap.

My issue is that when I am deploying, using phonegap build phonegap version 2.5, and having in my index:

<script src="phonegap.js"></script>

and not having the cordova library copied.

also in the index:

<body ng-app="MyApp">

<div class="container" ng-view></div>

The result is that the build is just great I can install it my iOS and android device and both are behaving the same.

I can see the background I set up in the CSS file but nothing else shows up. The alert I set up in the first controller dosen't show up neither. It works just well with the ripple emulation but dosen't work once deployed to iOS or android device.

I simplfied my index to the maximin also I am not using any directive that uses jquery to make sure this is not the issue, I am not even loadign any other library.

I added this meta info, as adviced in other SO question

<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />

I also added (also tried Brian Ford cool service) but for simplyfy

MyApp.run(function ($rootScope, $location) {       
    document.addEventListener('deviceready', function () { 
        navigator.notification.alert("Corodova device ready triggered!"); --> This does gets triggered!
        //MyApp.initialize(); => commented out cause it did not make any change and I beleive it is not needed. We already have <body ng-app="MyApp"> in index
}, false);    

});

I also left config.xml to the minimum:

<?xml version="1.0" encoding="UTF-8"?>
 <widget xmlns      = "***"
    xmlns:gap   = "http://phonegap.com/ns/1.0"
    id         = "***"
    version     = "1.0.2">

  <name>***</name>

  <description>***</description>

  <author email="***@***.com">***</author>

   <icon src="./styles/img/logo.png" gap:role="default" />  

  <feature name="http://api.phonegap.com/1.0/network"/>
  <feature name="http://api.phonegap.com/1.0/geolocation"/>
  <feature name="http://api.phonegap.com/1.0/camera"/>

  <preference name="orientation" value="portrait" />

  <preference name="phonegap-version" value="2.5.0" />
  <preference name="target-device" value="universal" />

  <!-- Splash Screens -->
  <gap:splash src="splash.png" />
  <gap:splash src="./styles/img/logo.png" gap:platform="android" gap:density="ldpi" />
  <gap:splash src="./styles/img/logo.png" gap:platform="android" gap:density="mdpi" />
  <gap:splash src="./styles/img/logo.png" gap:platform="android" gap:density="hdpi" />
</widget>

Thanks in advance!

4

1 回答 1

0

我终于找到了解决方案。

在为满足编码准则而进行重命名时,我将所有视图文件更改为驼峰式。但是我没有改变我的 app.js 看起来像:

 $routeProvider
 .when('/', {
    templateUrl: 'views/Sign.html',   <--- mind the case sensitive issue! the capital s screw it up  . . . 
    controller: 'SignCtrl'

在此处输入图像描述

于 2013-04-25T10:01:59.927 回答