【问题标题】:Ionic not working in IBM Mobilefirst PlatformIonic 在 IBM Mobilefirst 平台中不起作用
【发布时间】:2016-01-26 22:33:42
【问题描述】:

我在 IBM Mobilefirst 中创建了一个简单的项目。我有非常简单的离子布局:

<body style="display: none;">
    <ion-pane>
        <ion-header-bar class="bar-stable">
            <h1 class="title">Awesome App</h1>
        </ion-header-bar>
        <ion-content class="padding">
            <button class="button button-assertive">I'm a button</button>
        </ion-content>
    </ion-pane>
    <script src="js/initOptions.js"></script>
    <script src="js/main.js"></script>
    <script src="js/messages.js"></script>
</body>

另外,我做了 angular 的引导:

function wlCommonInit(){
    angular.element(document).ready(function(){
        angular.bootstrap(document, ['app']);
    }); 
}
angular.module('app', ['ionic']);

我在我的项目 v1.2.4 中包含了 Ionic 库并为它们提供了参考:

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

但我在预览应用程序时看不到任何内容。如果我使用的是 Ionic v1.0.0,它就可以工作。我做错了什么?我想使用 Ionic v.1.2.4

谢谢!

【问题讨论】:

    标签: angularjs ionic-framework ibm-mobilefirst


    【解决方案1】:

    尝试查看这篇博文,它涵盖了处理 ionic 和 MFPF 7.1 的一般步骤(如果这是您的版本)。

    http://www.raymondcamden.com/2015/08/19/developing-ionic-apps-with-mobilefirst-7-1/

    如果你的版本是 7.0,看看这个:

    http://www.raymondcamden.com/2015/03/24/working-with-ibm-mobilefirst-and-ionic-bootstraping/

    希望这些信息对您有所帮助,

    【讨论】:

      【解决方案2】:

      我找到了解决方案。我在填充整个屏幕的主体标签中添加了空的“容器”。我做到了:

      ma​​in.css

      #dimScreen    
      {
              position:fixed;
              padding:0;
              margin:0;
      
              top:0;
              left:0;
      
              width: 100%;
              height: 100%;
          }
      

      index.html

      <body style="display: none;" id = "dimScreen">
                  <ion-pane>
                      <ion-header-bar class="bar-stable">
                          <h1 class="title">Awesome App</h1>
                      </ion-header-bar>
                      <ion-content class="padding">
                      <button class="button button-assertive">I'm a button</button>
                      </ion-content>
                  </ion-pane>
                  <script src="js/initOptions.js"></script>
                  <script src="js/main.js"></script>
                  <script src="js/messages.js"></script>
              </body>
      

      【讨论】:

        猜你喜欢
        • 2015-04-09
        • 1970-01-01
        • 2015-07-26
        • 2016-07-14
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2016-07-18
        相关资源
        最近更新 更多