javascript - Angular 应用程序中的引导程序 5
问题描述
自第 5 版以来, Bootstrap框架已将jQuery作为一项要求移除。
我想知道此更改如何影响 Angular 应用程序?
我们可以在 Angular 中使用所有提供的引导功能(例如下拉菜单)吗?
我知道 Angular 不应该与 JQuery 结合使用——在早期版本的 Bootstrap 中,如果我们想使用所有引导功能,建议导入 JQuery,这很糟糕。
但是 Bootstrap 5 不再依赖 JQuery,所以在我的 Angular 应用程序中使用它是否安全?
至于现在我不想使用像 ng-bootstrap 这样的引导替代品,这就是为什么我要问在 Angular 中使用 Bootstrap 5是否可以且安全?
解决方案
安装引导程序只需使用
npm install bootstrap
并编辑 angular.json 文件
"styles": [
"node_modules/bootstrap/dist/css/bootstrap.min.css", //<--add this line
"src/styles.css"
],
"scripts": [
"node_modules/bootstrap/dist/js/bootstrap.bundle.min.js" //<--and this line
]
推荐阅读
- http - curl 能够从 https 获取;但是从 golang 的 http.get() 中,相同的 https URL 不起作用
- php - 如何使用(Axios、php 和 vue.js)在编辑表单中填充当前数据
- php - Facebook\WebDriver\Exception\ElementNotVisibleException:元素不可交互
- java - 如何通过@ControllerAdvice 中的@ResponseStatus 捕获异常
- android - RecyclerView - 如何将数据发送到 MainActivity
- blueprism - 如何从 Blueprism 中的多层集合中引用字段?
- api - 如果已经在 nginx 中配置了 https,我是否需要在我的应用程序中配置 https
- python - 使用机器学习根据之前的 6 个数字系列(训练数据)预测接下来的 6 个数字系列
- ios - 选择时更改 imageView 的 tintColor 不起作用
- asp.net-core - 如何从 Asp.net Core 中的查询字符串验证 Azure AD B2C 令牌?