2016-03-29 21 views
1

Angular2 + Typescript web uygulamasını oluşturdum. Tarayıcıda iyi çalışıyor. Phonegap kullanarak bu web uygulamasını mobil uygulamaya (android) dönüştürdükten sonra, yalnızca statik HTML oluşturur. Herhangi bir açısal2 bileşeni veya işlevselliği yüklemez, ekranda herhangi bir hata atar. enter image description herePhonegap - Angular2 uygulama mobile içinde yüklenmez.

herkes bana sorun ne olabilir bildirin misiniz: Burada

<!DOCTYPE html> 
<html lang="en"> 

<head> 
    <!--<base href="/">--> 
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0" /> 
    <title>My Goal Tracker</title> 

    <!-- CSS --> 
    <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"> 
    <link href="css/materialize.css" type="text/css" rel="stylesheet" media="screen,projection" /> 
    <link href="css/style.css" type="text/css" rel="stylesheet" media="screen,projection" /> 

    <script type="text/javascript" src="cordova.js"></script> 
    <script type="text/javascript"> 
     phonegapApp.initialize(); 
    </script> 


    <!-- 1. Load libraries --> 
    <!-- IE required polyfills, in this exact order --> 
    <script src="https://cdnjs.cloudflare.com/ajax/libs/es6-shim/0.35.0/es6-shim.min.js"></script> 
    <script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.20/system-polyfills.js"></script> 
    <script src="https://npmcdn.com/[email protected]/es6/dev/src/testing/shims_for_IE.js"></script> 

    <script src="https://code.angularjs.org/2.0.0-beta.12/angular2-polyfills.js"></script> 
    <script src="https://code.angularjs.org/tools/system.js"></script> 
    <script src="https://npmcdn.com/[email protected]/lib/typescript.js"></script> 
    <script src="https://code.angularjs.org/2.0.0-beta.12/Rx.js"></script> 
    <script src="https://code.angularjs.org/2.0.0-beta.12/angular2.dev.js"></script> 
    <script src="https://code.angularjs.org/2.0.0-beta.12/router.dev.js"></script> 



    <!-- 2. Configure SystemJS --> 
    <script> 
     System.config({ 
     packages: {   
      app: { 
      format: 'register', 
      defaultExtension: 'js' 
      } 
     } 
     }); 
     System.import('app/main') 
      .then(null, console.error.bind(console)); 
    </script> 

</head> 

<body> 

    <home>Loading...</home> 

    <footer class="page-footer orange"> 
     <div class="footer-copyright"> 
      <div class="container"> 
       Made by <a class="orange-text text-lighten-3" href="http://uvbrain.com">UVBrain Solutions</a> 
      </div> 
     </div> 
    </footer> 

    <!-- Scripts--> 
    <script src="https://code.jquery.com/jquery-2.1.1.min.js"></script> 
    <script src="js/materialize.js"></script> 
    <script src="js/init.js"></script> 

</body> 

</html> 

PhoneGap projesi yapısı aşağıdaki gibidir index.html nedir?

Şimdiden teşekkürler!

+0

[bu benzer soruya bakın] (http://stackoverflow.com/questions/35436047/angular-2-in-phonegap-doesnt-work-plain-javascript) –

+0

@Chavan Gerçekten hem * Phongap Build'i kullanıyorsunuz * ve * Phonegap CLI *. Bu normal değil. Corodova/Phonegap [CLI, SDK veya Build] için üç (3) farklı sistem vardır (https://github.com/jessemonroy650/top-phonegap-mistakes/blob/master/new-to-Phonegap.md#001) . Hangisini kullanıyorsun? – JesseMonroy650

+0

@ JesseMonroy650, Phonegap Desktop uygulamasını kullanarak boş bir uygulama oluşturdum. Sonra www klasöründe angular2 web sitesi kodumu koydum. Bundan sonra telefongap servisini çalıştırdım ve cep telefonumda test ettim. – Chavan

cevap

-3

Hata ayıklama günlüklerini ve uyarılarını yükledikten sonra, sorunu buldum. Soruna neden olan ng2'nin yönlendirme mekanizması ile oldu.

+0

'u kullanarak aynı sorunu yaşıyorum, bunu nasıl çözdünüz? –

+2

Bunu bir cevap olarak düşünmüyorum, lütfen bir tane sağlayın. – Goowik

İlgili konular