【问题标题】:AngularUI bootstrap popover issue with AngularJSAngularJS的AngularUI引导弹出问题
【发布时间】:2020-02-13 14:34:04
【问题描述】:

我正在尝试使用 Bootstrap 和 angularJS 实现弹出框功能,但弹出框似乎不起作用并且我也没有收到任何错误。任何帮助将不胜感激

<button popover-template="'popover.html'"
        popover-placement="top"
        popover-trigger="click"
        type="button"
        class="btn btn-default">
  Mouse over me
</button>

我添加了 ngAnimate 和 ui.bootstrap 作为我的 Angular 应用程序的依赖项。这是popover.html的代码

<label class="Label">
    test
</label>

它不会在点击时真正创建弹出框,也不会创建错误消息。

【问题讨论】:

    标签: angularjs angular-ui-bootstrap popover


    【解决方案1】:

    指令的名称是uib-popover-template:

    <button ̶p̶o̶p̶o̶v̶e̶r̶-̶t̶e̶m̶p̶l̶a̶t̶e̶=̶"̶'̶p̶o̶p̶o̶v̶e̶r̶.̶h̶t̶m̶l̶'̶"̶
            uib-popover-template="'popover.html'"
            popover-placement="top"
            popover-trigger="click"
            type="button"
            class="btn btn-default">
      Mouse over me
    </button>
    

    有关详细信息,请参阅

    有关详细信息,请参阅

    【讨论】:

    • popover 工作是否需要最低 angularJS 和引导版本?我猜这可能是问题,因为我创建了一个基本的网络应用程序并尝试实现该功能并且似乎可以工作,但是当我开始在现有应用程序中实现时它似乎不起作用
    • AngularUI Bootstrap 与 Bootstrap 3 一起使用。它尚未更新为与 Bootstrap 4 一起使用。如果您想查看 Angular UI Bootstrap 是否与旧版本的 AngularJS 一起使用,请自己进行演示和实验。我个人建议使用最新版本的 AngularJS 进行安全升级。
    猜你喜欢
    • 2015-09-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-11-02
    • 1970-01-01
    • 2013-09-13
    相关资源
    最近更新 更多