2014-09-03 73 views
0

我创建使用离子框架的PhoneGapAngularJS一个应用程序上的空白屏幕。应用程序在浏览器工作正常,手机

我有一个指令,项目。在浏览器中运行应用程序时,该指令工作得很好。但是,当运行iOS 7上我的iPhone 5C上编译的应用程序时,该指令不显示。

如果我复制该指令的HTML模板并将其放到页面上,它就可以正常工作。

这里的指令:

ItemModule.directive('item', ['$rootScope', function ($rootScope) { 
    return { 
     restrict: 'E', 
     scope: { 
      item: '=', 
     }, 

     transclude: true, 

     templateUrl: 'js/modules/items/directives/templates/item.html', 

     link: function (scope, iElement, iAttrs) { 
     } 
    }; 
}]) 

我在做什么错?

+0

是否有运行appon电话时任何JavaScript错误?你可以使用Safari的web检查器来确保。 – 2014-09-03 08:32:55

+0

没有错误 – 2014-09-03 09:17:02

+0

把这个放在所有index.html js脚本的顶部:** ** – sbaaaang 2014-09-03 09:44:30

回答

0

你说ajax调用成功了,但它执行正确吗?

试试你的指令之前右:

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

    $sceDelegateProvider.resourceUrlWhitelist([ 
     // Allow same origin resource loads. 
     'self', 
     // Allow loading from our other assets domain. Notice there is a difference between * and **. 
     'http://km.support.apple.com/**', 
    ]); 
}) 
-1

这看起来是分辨率问题。请根据电话设备检查分辨率。

页面上有固定的高度/宽度控制,不允许在电话上呈现页面并显示空白屏幕。

为了使您的Web应用程序响应,您也可以使用bootstrap!

+0

内容没有样式,所以它不是解决问题 – 2014-09-03 10:33:35

相关问题