[英]Application working fine in the browser, blank screen on the phone
I am creating an app using the Ionic Framework , Phonegap and AngularJS . 我正在使用Ionic Framework , Phonegap和AngularJS创建一个应用程序。
I have a directive, Item . 我有一个指令Item 。 This directive works just fine when running the application in the browser.
在浏览器中运行应用程序时,此指令可以正常工作。 However, when running the application compiled on my iPhone 5C with iOS7, the directive is not showing up.
但是,在运行带有iOS7的iPhone 5C上编译的应用程序时,该指令未显示。
If I copy the HTML template of the directive and drops it onto the page, it works just fine. 如果我复制指令的HTML模板并将其放到页面上,它就可以正常工作。
Here is the directive: 这是指令:
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) {
}
};
}])
What am I doing wrong? 我究竟做错了什么?
you say the ajax call is coming successfully, but is it executing correctly? 您说ajax调用成功进行,但是执行正确吗?
try right before your directive: 请在您的指令前尝试:
.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/**',
]);
})
This looks resolution problem. 这看起来是分辨率问题。 Please check the resolution as per phone device.
请根据电话设备检查分辨率。
There is fixed height/width control on the page which is not allowing to render page on Phone and showing blank screen. 页面上有固定的高度/宽度控件,不允许在手机上呈现页面并显示空白屏幕。
To make your web application responsive, you can use bootstrap as well!!! 为了使您的Web应用程序具有响应能力,您还可以使用引导程序!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.