2014-02-27 75 views
-3

我正在尝试将ionic framework添加到我的应用程序中。IBM Worklight 6.1 - 如何集成Ionic框架?

为此,我从离子网站下载了“starter template”。该应用程序的index.html文件似乎正确运行在浏览器上,没有任何问题。但是在构建Android环境之后,应用程序仅显示一个没有任何内容的白屏。

以下是工作灯项目:https://dl.dropboxusercontent.com/u/54761340/angulartest.zip

+0

用以下方式编辑您的问题:Worklight版本,运行应用程序时从LogCat中记录日志,您为集成框架所采取的步骤,链接到框架网站,以及您没有告诉我们的任何其他内容。 –

+0

也上传Worklight项目,而不是生成的Android项目。 –

+0

上传的zip文件是worklight项目而不是生成的android项目。离子框架的网站如下,.... – user3352510

回答

1

我不太明白这是在任何地方运行,因为HTML是borked:

  • 复制HTMLBODY元素
  • 不正确的位置引用.css和.js文件...

执行以下操作:

  1. 打开angulartest\apps\angulartestapp\common\index.html,并替换为以下内容:在angulartestapp文件夹

    <!DOCTYPE html> 
    <html ng-app="ionicApp"> 
        <head> 
         <meta charset="UTF-8"> 
         <title>Ionic</title> 
         <link rel="shortcut icon" href="images/favicon.png"> 
         <link rel="apple-touch-icon" href="images/apple-touch-icon.png"> 
         <link rel="stylesheet" href="css/main.css"> 
         <link rel="stylesheet" href="css/ionic.min.css"> 
         <script src="js/ionic.bundle.min.js"></script> 
         <script> 
          window.$ = window.jQuery = WLJQ; 
         </script> 
        </head> 
    
        <body ng-controller="MyCtrl"> 
         <ion-header-bar title="myTitle"></ion-header-bar> 
         <ion-content has-header="true" padding="true"> 
          <h2>Content</h2> 
         </ion-content> 
    
         <script src="js/index.js"></script> 
         <script src="js/initOptions.js"></script> 
         <script src="js/main.js"></script> 
         <script src="js/messages.js"></script> 
        </body> 
    </html> 
    
  2. 右键单击并选择Run As>工作灯开发服务器上运行

  3. 右键单击生成的Android项目并选择运行方式> Android应用程序

我已经在Worklight Console的MBS以及Android模拟器中测试过它。似乎工作,不管它是什么...

0
<body id='content'> 
</body> 

它将与工作灯冲突。

您只是尝试删除id ='content'并重试。

但这可能会使deviceReady()函数永远不会准备就绪。

相关问题