2017-02-16 1 views
0

저는 도구 사용 방법을 배우기 위해 Ionic을 사용하여 매우 간단한 앱을 개발하고 있습니다. 그것은 탭을 의미하며, 공식 문서에있는 탭에 대한 자습서를 따랐습니다. 그것은 내 브라우저에서 잘 작동하지만 컴파일 할 때 안드로이드 장치에 "죽음의 빈 화면"이 있습니다. 여기 이오니아 간단한 앱이 모바일에서 작동하지 않습니다.

내 단순 코드이다

에 Index.html

<html ng-app="ionicApp"> 
    <head> 
    <meta charset="utf-8"> 
    <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width"> 
    <title>Home</title> 
    <link href="//code.ionicframework.com/nightly/css/ionic.css" rel="stylesheet"> 
    <script src="//code.ionicframework.com/nightly/js/ionic.bundle.js"></script> 
    </head> 

    <body> 
    <ion-nav-bar class="bar-positive"> 
     <ion-nav-back-button> 
     </ion-nav-back-button> 
    </ion-nav-bar> 

    <ion-nav-view></ion-nav-view> 

    <script id="templates/tabs.html" type="text/ng-template"> 
     <ion-tabs class="tabs-icon-top tabs-positive"> 
     <ion-tab title="Home" icon="ion-home" href="#/tab/home"> 
      <ion-nav-view name="home-tab"></ion-nav-view> 
     </ion-tab> 
     </ion-tabs> 
    </script> 

    <script id="templates/home.html" type="text/ng-template"> 
     <ion-view view-title="Menu Principal"> 
     <ion-content class="padding"> 
      <a href="#/tab/sceneTest"><img class="popphoto" src="b_menu1.png"></a> 
     </ion-content> 
     </ion-view> 
    </script> 

    </body> 

JS 부 :

<script> 
    angular.module('ionicApp', ['ionic']) 

    .config(function($stateProvider, $urlRouterProvider) { 

    $stateProvider 
     .state('tabs', { 
     url: "/tab", 
     abstract: true, 
     templateUrl: "templates/tabs.html" 
     }) 

     .state('tabs.home', { 
     url: "/home", 
     views: { 
      'home-tab': { 
      templateUrl: "templates/home.html", 
      controller: 'HomeTabCtrl' 
      } 
     } 
     }) 

     .state('tabs.sceneTest', { 
     url: "/sceneTest", 
     views: { 
      'home-tab': { 
      templateUrl: "sceneTest.html" 
      } 
     } 
     }) 

    $urlRouterProvider.otherwise("/tab/home"); 
    }) 

    .controller('HomeTabCtrl', function($scope) { 
    console.log('HomeTabCtrl'); 
    }); 
    </script> 
</html> 

은 "sceneTest.html"된 index.html 파일과 같은 경로에 . 나는 버그가 원인이라고 생각하지 않는다. 왜냐하면 그 내용은 지금까지 아주 단순하기 때문이다 (단지 텍스트가 이온보기에 싸여있다).

휴대 전화에서만 빈 화면이 표시 될 수 있습니다. 나는 내가 제대로하지 않은 일부 흠도 때문에 그것이있을 수 있다고 들었습니다. 그러나 이오닉과 앵귤러 (jQuery 팬이 마음을 열려고 노력하는)에 매우 익숙하므로 정확한 원인을 찾기가 어렵습니다.

도움을 주셔서 감사합니다.

답변

1

전화 앱의 WWW 폴더와 파일

잘못된 방법이 실제로 작동

<link href="lib/ionic/css/ionic.css" rel="stylesheet"> 
<script src="lib/ionic/js/ionic.bundle.js"></script> 
+0

<link href="//code.ionicframework.com/nightly/css/ionic.css" rel="stylesheet"> <script src="//code.ionicframework.com/nightly/js/ionic.bundle.js"></script> 

좋은 방법. 고마워요! – Driblou

관련 문제