2013-04-24 22 views
1

我正在開發一個應用程序使用angularjs和phonegap。移動應用程序沒有顯示任何視圖在啓動iPhone和Android設備

我的問題是,當我部署,使用的PhoneGap構建PhoneGap的版本2.5,並具有在我的索引:

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

和不具有科爾多瓦庫複製。

也在指數:

<body ng-app="MyApp"> 

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

結果是構建下好了,我可以安裝我的iOS和Android設備和兩者都表現相同。

我可以看到我在CSS文件中設置的背景,但沒有其他顯示。 我在第一個控制器中設置的警報不會顯示出來。它適用於漣漪仿真,但一旦部署到iOS或Android設備就無法工作。

我簡化了我的索引到maximin我也沒有使用任何指令,使用jquery確保這不是問題,我甚至沒有加載任何其他庫。

我加入這個元信息,如勸其他SO質疑

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

我還添加了(也試過Brian Ford cool service),但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);  

});提前

<?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> 

感謝:

我也離開config.xml中最低!

回答

0

我終於找到了解決方案。

在爲滿足編碼準則進行重命名時,我將所有視圖文件更改爲駱駝大小寫。但是我沒有改變我的app.js看起來像:

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

enter image description here

相關問題