简体   繁体   English

Angular 5:ngx-bootstrap popover问题

[英]Angular 5: ngx-bootstrap popover issue

I am trying to add ngx-bootstrap popover to my application. 我正在尝试将ngx-bootstrap popover添加到我的应用程序。 But it only works when I import the popover package in the module I use it. 但是,仅当我在使用它的模块中导入popover程序包时,它才有效。 Importing the package in app.module.ts wouldn't work. 无法将包导入app.module.ts中。 So, i have to import it in all the modules i need it. 因此,我必须将其导入我需要的所有模块中。 Is there a work around for this, so i need not import it in all the modules? 有没有解决的办法,所以我不需要将其导入所有模块中吗?

PS I am not using system.config.js. PS我不使用system.config.js。

Versions - 版本-

@angular/cli - 1.4.7 @ angular / cli-1.4.7

ngx-bootstrap - 2.0.2 ngx-bootstrap-2.0.2

Maybe just use the one I wrote. 也许只用我写的那本书。 https://github.com/MrFrankel/ngx-popper https://github.com/MrFrankel/ngx-popper

Its quite advanced. 它相当先进。

A workaround would be to create a SharedModule which imports and imports the Popover module. 一种解决方法是创建一个SharedModule,以导入和导入Popover模块。

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

Obviously, this is only useful if you have other modules that you need to import in each of your other modules 显然,这仅在您需要在其他每个模块中导入其他模块的情况下才有用

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM