如何在角度项目中包含popper.js和bootstrap.js [英] How to include popper.js and bootstrap.js in angular project
问题描述
我在openlayers中使用了angular,并且我遵循下面链接中发布的示例:
I am using angular with openlayers and I am following the example posted below in the link:
https://openlayers.org/en/latest/examples/overlay.html
上述链接提供了以下信息,以便与弹出窗口配合使用:
the aforementioned link provide the following information in order to work with the popover:
Things to know when using the popover plugin:
Popovers rely on the 3rd party library Popper.js for positioning. You must include popper.min.js before bootstrap.js or use bootstrap.bundle.min.js / bootstrap.bundle.js which contains Popper.js in order for popovers to work!
请让我知道如何添加
popper.js
和
bootstrap.js
所以我可以使用popover功能并使它工作.
so i can work with the popover function and get it working.
图片:
推荐答案
您可以在angular.json文件的build部分下的样式中添加 node_modules/dist/css/boostrap.min.css
src/styles.css
.您可以从npm软件包 npm install bootstrap
You can add node_modules/dist/css/boostrap.min.css
in styles under the build section of angular.json file BEFORE src/styles.css
. You can download the bootstrap from the npm package npm install bootstrap
为了使用弹出窗口,您可以在脚本的build部分下的脚本中添加引导程序 node_modules/bootstrap/dist/js/bootstrap.bundle.min.js
的捆绑文件.相同的文件.
In order to work with the pop ups you can add the bundle file of bootstrap node_modules/bootstrap/dist/js/bootstrap.bundle.min.js
in the scripts under the build section of the same file.
您还必须下载JQuery并将其添加到脚本部分.
You have to download JQuery and add it to your scripts section as well.
这篇关于如何在角度项目中包含popper.js和bootstrap.js的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!