【问题标题】:AngularJs open external links in an cordova appAngularJs 在科尔多瓦应用程序中打开外部链接
【发布时间】:2016-04-28 12:31:08
【问题描述】:

在科尔多瓦应用程序中使用 ng-bind-html 尝试打开外部链接。

  1. 我已经安装了InAppBrowser插件

  2. 然后我按照以下的确切步骤进行操作 https://gist.github.com/rewonc/e53ad3a9d6ca704d402e

  3. 带有过滤器的代码被执行,其中的链接被改变,即 href 到 window.open 代码。

但是当我点击链接时没有任何反应。

还有什么我遗漏的吗?

【问题讨论】:

    标签: angularjs cordova-plugins angularjs-filter ngsanitize


    【解决方案1】:

    下面是使用 ng-bind-html 的 html

    <div class="card" ng-if="extendedDescription">
                <div class="item item-divider">
                    Ext Description
                </div>
                <label class="item item-text-wrap">
                    <span ng-bind-html="extendedDescription">
                    </span>
                </label>
            </div>
    

    span 元素被包裹在 label 元素中,因此触发的所有事件都没有改变

    the &lt;label to only contain &lt;span

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-05-20
      • 1970-01-01
      • 1970-01-01
      • 2015-06-28
      相关资源
      最近更新 更多