【问题标题】:ng-show and ng-hide fails in html5/js chrome extensionng-show 和 ng-hide 在 html5/js chrome 扩展中失败
【发布时间】:2014-08-05 12:59:01
【问题描述】:

我对 ng-hide 和 ng-show 在我的 chrome 扩展程序中的行为感到困惑:https://chrome.google.com/webstore/detail/zombiereport/nmojhgiclaimobhpljphbfgmabfmncin

当我把它放到网上时,它工作得很好:http://1ffa3ba638.url-de-test.ws/zombieReport/partials/popup.html

在表单中,ng-show 和 ng-hide 默认自动可见(在扩展中)。

【问题讨论】:

  • 究竟哪一部分用到了ng-show和hide?​​span>
  • 喜欢成功和错误消息successMailZR / errorMailZR
  • 我手动将 false 设置为默认值,但在扩展程序中,我看到了消息
  • 没人回答 :( ?
  • @FacePalm:您为 Chrome 应用程序使用了错误的标签,而您的 angularjs-ng-show 可能不是一个好标签(只有 4 个问题,太具体了)

标签: angularjs google-chrome-extension google-chrome-app


【解决方案1】:

我遇到了同样的问题。确保在扩展 index.html 文件中包含 angular-csp.css 文件。你可以download it here。还要确保在html 标签上使用ng-csp 指令。

让我知道这是否适合你。

【讨论】:

  • 谢谢!我只需要这个 csp css 文件,它的工作原理:)
  • 是的,这有帮助。来自 AngularJS 文档的更多信息:“CSP 禁止 JavaScript 内联样式表规则。在非 CSP 模式下,Angular 自动包含一些 CSS 规则(例如 ngCloak)。使这些指令在 CSP 中工作模式,手动包含 angular-csp.css。”
猜你喜欢
  • 1970-01-01
  • 2015-02-12
  • 2014-12-08
  • 2014-03-27
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-01-30
相关资源
最近更新 更多