ngx-bootstrap 下拉菜单在其他模块中不起作用
这个问题会让我误以为是 Angular 的新手,尽管我已经使用它很长时间了。我需要帮助解决这个问题吗?我正在尝试使用 Ngx-Bootstrap 下拉列表,当我在 AppModule 中使用它时,这可以工作,但是当我尝试在应用程序的其他模块中使用它时,这不起作用。我试图将其导入到示例代码中解释的其他模块中,但这不起作用。我在 Angula 5 中有一个应用程序,它在过时的版本中使用这个库,它对我来说工作得很好,但是当我尝试在最新版本的 Angula 13 中使用它时,它不起作用。我创建了一个具有相同场景的示例项目,但得到了相同的结果。
我
也有尝试在新模块中导入 BsDropdownModule 模块,但这会导致应用程序无法运行。
This question will pass me off as a newbie to angular even though I've been working with it for a long time. Do I want help with this problem. I am trying to use Ngx-Bootstrap dropdown, this works when I use it in AppModule, but when I try to use it in other modules of my app, this doesn't work. I'm trying to import this into other modules explaining in their sample codes, but this doesn't work. I have an application in angular 5 that uses this library in an outdated version and it works fine for me, but when I try to use it in Angula 13 with the latest version it doesn't work. I created a sample project with the same scenario but I have the same result.
https://stackblitz.com/edit/angular-ivy-fsjxn8
I have also tried to import the BsDropdownModule module in the new module but this causes the application not working.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将 Auth 模块更新为
记住要注意 BsDropdownModule 的库
from import { BsDropdownModule } from 'ngx-bootstrap/dropdown/public_api';
从 'ngx-bootstrap/dropdown' 导入 { BsDropdownModule };
我已经更改了您的项目,如果您想检查 查看此链接
它应该可以工作,有一个很好的编码!
Update Auth module to
Remember to pay attention on the library of BsDropdownModule
from import { BsDropdownModule } from 'ngx-bootstrap/dropdown/public_api';
to import { BsDropdownModule } from 'ngx-bootstrap/dropdown';
I've changed your project, if you want to check see this link
It should work, have a nice coding!