在浏览器中的离子NG-节目的工作而不是在Android / IOS [英] ionic ng-show working in browser but not on android/ios
问题描述
我现在面临一个恼人的问题,我不能够解决,这code完美的作品在浏览器中而不是在Android / iOS设备:
i'm facing an annoying issue that i'm not able to solve, this code works perfectly in the browser but not on the android/ios devices:
<ion-view style="" title="Dettaglio">
<ion-content class="has-header" padding="true">
<div style="" class="list card">
<div class="item item-divider" ng-show="conditions">{{conditions.nome}} {{conditions.cognome}}</div>
<div class="item item-divider" ng-hide="conditions">Errore!!</div>
<div class="item item-body">
<div style="" ng-show="conditions">
<p>
Residuo: {{conditions.residuo}}
</p>
</div>
<div style="" ng-hide="conditions">
<p>
Utente non registrato o codice fiscale errato
</p>
</div>
</div>
</div>
<div style="display: inline-block; width: 300px; height: 17px;" class="spacer"></div>
<div style="" class="list card" ng-show="conditions">
<div class="item item-divider">Note</div>
<div class="item item-body">
<div style="">
<p>
{{conditions.note}}
</p>
</div>
</div>
</div>
</ion-content>
在测试应用程序在Windows浏览器中的NG-隐藏/ NG-显示工作按预期隐藏或显示的div,但一旦我得到在Android应用程序/ iOS设备的每个div正在显示不管是什么。
我有点新角/离子但我不明白为什么NG-显示指令是工作在浏览器,但不是在设备上。
While testing the app in the Windows browser the ng-hide/ng-show work as intended hiding or showing the divs, but once i get the app on the android/ios devices each div is being displayed no matter what. i'm kinda new to angular/ionic but i can't understand why the ng-show directive is working in the browser but not on the devices.
在此先感谢
推荐答案
我在浏览器和Android手机都这个问题。它是由最近的升级在科尔多瓦的安全性,并且需要一个更好的内容安全性政策造成的。
I had this problem in both the browser and my Android phone. It was caused by a recent upgrade in Cordova's security, and the need for a better "Content-Security-Policy".
我固定它通过index.html中加入这一行:
I fixed it by adding to this line in index.html:
<meta http-equiv="Content-Security-Policy" content="default-src...
我说:
'unsafe-inline' 'unsafe-eval'
这篇关于在浏览器中的离子NG-节目的工作而不是在Android / IOS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!