【问题标题】:Angular 5: ngx-bootstrap popover issueAngular 5:ngx-bootstrap 弹出框问题
【发布时间】:2023-03-06 04:53:01
【问题描述】:

我正在尝试将 ngx-bootstrap 弹出窗口添加到我的应用程序中。但它只有在我使用它的模块中导入 popover 包时才有效。在 app.module.ts 中导入包是行不通的。所以,我必须在我需要的所有模块中导入它。有没有办法解决这个问题,所以我不需要在所有模块中导入它?

附:我没有使用 system.config.js。

版本 -

@angular/cli - 1.4.7

ngx-bootstrap - 2.0.2

【问题讨论】:

  • 你要找的是通用模块

标签: angular ngx-bootstrap


【解决方案1】:

也许只使用我写的那个。 https://github.com/MrFrankel/ngx-popper

它相当先进。

【讨论】:

    【解决方案2】:

    一种解决方法是创建一个用于导入和导入 Popover 模块的 SharedModule。

    https://angular.io/guide/sharing-ngmodules

    显然,这仅在您需要在每个其他模块中导入其他模块时才有用

    【讨论】:

    • 谢谢,我尝试了同样的方法,但我错过了从我的共享模块中导出弹出模块。它在从共享模块导出后工作。
    猜你喜欢
    • 2018-08-03
    • 2023-02-17
    • 1970-01-01
    • 1970-01-01
    • 2018-08-24
    • 2019-08-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多